@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

/* Main Wrapper Scoping */
.mgc-verifier-wrapper {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333333;
    line-height: 1.6;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.mgc-verifier-wrapper * {
    box-sizing: border-box;
}

/* 1. Flat Search Card (Matches Distributor/Contact Section style) */
.mgc-search-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 40px 30px;
    margin-bottom: 40px;
    text-align: center;
}

.mgc-search-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #003366; /* Maheshwari Primary Navy */
    margin: 0 0 10px 0;
    letter-spacing: -0.01em;
}

.mgc-search-header p {
    color: #555555;
    font-size: 15px;
    margin: 0 0 30px 0;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Form Input Group (Matches Quote form styling) */
.mgc-search-form {
    max-width: 650px;
    margin: 0 auto 20px auto;
}

.mgc-input-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.mgc-input-group input[type="text"] {
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 15px;
    color: #333333;
    outline: none;
    transition: border-color 0.2s ease;
    height: 50px;
}

.mgc-input-group input[type="text"]:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.15);
}

.mgc-input-group input[type="text"]::placeholder {
    color: #888888;
}

/* Primary Corporate Pill Button (Matches Quote and header action style) */
.mgc-submit-btn {
    background: #003366; /* Maheshwari Primary Navy */
    color: #ffffff;
    border: none;
    border-radius: 50px; /* Pill Shape */
    padding: 0 32px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.mgc-submit-btn:hover {
    background: #002244;
}

/* Loading Spinner */
.btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 100%;
    height: 100%;
}

.spinner .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.mgc-search-example {
    font-size: 14px;
    color: #666666;
}

.mgc-example-link {
    color: #b89c66; /* Maheshwari Accent Gold */
    text-decoration: underline;
    font-weight: 600;
    margin-left: 5px;
}

.mgc-example-link:hover {
    color: #9b8150;
}

/* 2. Results Container & Cards */
.mgc-results-container {
    opacity: 0;
    display: none;
    transition: all 0.3s ease;
}

.mgc-results-container.active {
    opacity: 1;
    display: block;
}

.mgc-result-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 35px;
    margin-top: 20px;
}

/* Success Card Indicator Header */
.verified-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #d1fae5;
    color: #065f46;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
    flex-shrink: 0;
}

.indicator-texts h3 {
    font-size: 20px;
    font-weight: 700;
    color: #065f46; /* Success Green Header */
    margin: 0;
}

.indicator-texts p {
    color: #666666;
    margin: 5px 0 0 0;
    font-size: 14px;
}

/* Error layout indicator */
.error-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
    flex-shrink: 0;
}

.error-indicator h3 {
    font-size: 18px;
    font-weight: 700;
    color: #991b1b;
    margin: 0;
}

.error-message-text {
    color: #555555;
    margin: 8px 0 0 0;
    font-size: 14px;
}

/* 3. The Certificate Details Grid (Matching Contact Page Grid/Table layout) */
.mgc-cert-slip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
}

.mgc-slip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #003366; /* Accent border matching MGC Primary Navy */
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.company-brand h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #003366;
}

.company-brand .logo-accent {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #b89c66; /* Logo gold color */
    display: block;
    margin-bottom: 2px;
}

.slip-type {
    font-size: 11px;
    font-weight: 700;
    color: #555555;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Details Table Row list */
.mgc-slip-grid {
    display: flex;
    flex-direction: column;
}

.slip-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.slip-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.slip-label {
    color: #666666;
    font-weight: 500;
    font-size: 14px;
}

.slip-val {
    color: #333333;
    font-weight: 600;
    font-size: 14px;
}

.slip-val.highlight-val {
    color: #003366;
    font-weight: 700;
}

.slip-val.font-accent {
    font-size: 16px;
    color: #111111;
    font-weight: 700;
}

/* Flat Badge matching Dashboard Badge */
.slip-val.status-verified {
    color: #065f46;
    background-color: #d1fae5;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    display: inline-block;
}

.slip-val.status-pending {
    color: #92400e;
    background-color: #fef3c7;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    display: inline-block;
}

.slip-val.status-revoked {
    color: #991b1b;
    background-color: #fee2e2;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    display: inline-block;
}

.mgc-slip-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 20px;
    text-align: center;
}

.mgc-slip-footer p {
    font-size: 12px;
    color: #888888;
    margin: 0;
}

.mgc-slip-footer p.timestamp {
    font-size: 11px;
    margin-top: 4px;
}

/* Form Action Buttons (Matches primary pill buttons on page) */
.mgc-result-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.mgc-btn-print {
    background: #003366; /* Maheshwari Primary Navy */
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mgc-btn-print:hover {
    background: #002244;
}

.mgc-btn-clear {
    background: #ffffff;
    color: #555555;
    border: 1px solid #cbd5e1;
    border-radius: 50px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.mgc-btn-clear:hover {
    background: #f1f5f9;
    color: #333333;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Responsive queries */
@media (max-width: 640px) {
    .mgc-search-card {
        padding: 30px 20px;
    }
    
    .mgc-input-group {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .mgc-input-group input[type="text"] {
        height: 48px;
    }
    
    .mgc-submit-btn {
        width: 100%;
        height: 48px;
    }
    
    .mgc-result-card {
        padding: 25px 20px;
    }
    
    .slip-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px 0;
    }
    
    .mgc-result-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .mgc-btn-print, .mgc-btn-clear {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .mgc-verifier-wrapper,
    #mgc-results-container,
    .mgc-result-card,
    .mgc-cert-slip,
    .mgc-cert-slip * {
        visibility: visible;
    }
    
    .mgc-verifier-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .mgc-result-card {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .mgc-cert-slip {
        border: 1px solid #000000 !important;
        background: #ffffff !important;
        padding: 30px !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }
    
    .slip-row {
        border-bottom: 1px solid #dddddd !important;
        padding: 10px 0 !important;
        display: grid !important;
        grid-template-columns: 220px 1fr !important;
    }
    
    .no-print {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}
