/*
 * General styles for the MGS Plugin (Desktop)
 */
.mgs-placeholders-row td {
    text-align: center;
    font-weight: bold;
    color: #444;
    padding: 10px;
    letter-spacing: 1px;
}

.mgs-chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin: 20px 0;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: #fff;
    padding: 0px;
    box-sizing: border-box;
}

canvas {
    max-width: 100%;
    height: 100% !important;
}

.mgs-filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-family: 'system-ui', sans-serif;
}

.mgs-filter-controls label {
    font-weight: 600;
    color: #333;
}

.mgs-filter-controls select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mgs-filter-controls select:focus {
    outline: none;
    border-color: #6B8E23;
    box-shadow: 0 0 5px rgba(107, 142, 35, 0.5);
}

canvas {
    transition: all 0.5s ease-in-out;
}

.mgs-table-container {
    overflow-x: auto;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.mgs-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95rem;
    text-align: center;
}

.mgs-data-table th,
.mgs-data-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid #c8e6c9;
    white-space: nowrap;
}

.mgs-data-table th {
    background-color: #f2f2f2;
    color: #333;
    background-color: #dcedc8;
    color: #0a532c;
    font-weight: 600;
}

.mgs-data-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.mgs-data-table tbody tr:last-child td {
    border-bottom: none;
}

.mgs-data-table tbody tr:hover {
    background-color: #f1f1f1;
    background-color: #f1f8e9;
}

.mgs-search-box {
    background-color: #e8f5e9;
    padding: 3.5rem;
    border-radius: 3rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-width: 900px;
    margin: 2rem auto;
}

.mgs-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.mgs-button-wrapper {
    text-align: center;
    margin-top: 1px;
    margin-bottom: 10px;
}

.mgs-button {
    font-size: 0.9rem;
    padding: 0.75em 1.25rem;
    border: 2px solid #58bf5b;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #388e3c;
    color: #388e3c;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #388e3c;
    color: #ffffff;
    border-color: #388e3c;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mgs-select {
    font-size: 0.9rem;
    padding: 0rem 1.25rem;
    border: 2px solid #c8e6c9;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #388e3c;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 250px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23388e3c'%3e%3cpath d='M7 7l3 3 3-3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
}

.mgs-select:focus,
.mgs-button:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.25);
}

.mgs-button:hover {
    background-color: #2e7d32;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.mgs-button:disabled {
    background-color: #0a532c;
    border-color: #d1d5db;
    color: #f7f8fa;
    cursor: not-allowed;
    box-shadow: none;
}

.mgs-faq-container {
    background: #f9fdf9;
    border: 1px solid #d4e8d4;
    border-radius: 12px;
    padding: 25px 30px;
    margin: 30px 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    color: #222;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.mgs-faq-container h3 {
    color: #064f2a;
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    border-left: 4px solid #0b6b3b;
    padding-left: 12px;
    line-height: 1.4;
}

.mgs-faq-container p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 15px;
    color: #333;
}

.mgs-faq-container b {
    color: #0b6b3b;
    font-weight: 600;
}

.mgs-cards-container {
    margin: 20px auto;
    max-width: 1200px;
}

.mgs-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mgs-select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.mgs-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.mgs-card {
    background: #ede8c9;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0px 2px 6px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;   /* required for pseudo-elements */
    overflow: hidden;     /* ensures fade overlay stays inside */
}

/* Top fade */
.mgs-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px; /* fade thickness */
    background: linear-gradient(to bottom, #ffffff, transparent);
    z-index: 1;
    pointer-events: none;
}

/* Bottom fade */
.mgs-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px; /* fade thickness */
    background: linear-gradient(to top, #ffffff, transparent);
    z-index: 1;
    pointer-events: none;
}


.mgs-card-icon img {
    width: 40px;
    height: auto;
    margin-bottom: 10px;
}

.mgs-card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
}

.mgs-card-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.mgs-card-list li {
    font-size: 15px;
    margin: 5px 0;
}

.mgs-btn {
    display: inline-block;
    background: #064d2f;
    color: #fff;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.3s;
}

.mgs-btn:hover {
    background: #0a6d45;
}

/* Responsive styles for screens up to 768px wide */
@media (max-width: 768px) {
    .mgs-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .mgs-select {
        width: 100%;
    }
    .mgs-button {
        width: 100%;
    }
    .mgs-table-container {
        max-width: 100%;
    }
    .mgs-chart-container {
        max-width: 100% !important;
        width: 100% !important;
    }
    .mgs-faq-container {
        padding: 20px;
    }
    .mgs-faq-container h3 {
        font-size: 1.1rem;
    }
    .mgs-faq-container p {
        font-size: 0.95rem;
    }
}
