/**
 * Premium Digital Certificate CSS Stylesheet
 * Custom Styling (Navy Blue & Luxurious Gold Theme, Glassmorphism, Responsive Grid)
 */

/* Container and General Styling */
.sd-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
}

/* Common Card Styling (Glassmorphism) */
.sd-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    padding: 30px;
    margin-bottom: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sd-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
    border-color: rgba(217, 119, 6, 0.3); /* Soft Gold hover */
}

/* Dashboard Header & Welcome Section */
.sd-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    border-bottom: 2px solid rgba(15, 23, 42, 0.05);
    padding-bottom: 20px;
}

.sd-welcome-info h2 {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    color: #0f172a;
    margin: 0 0 5px 0;
    font-weight: 700;
}

.sd-subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.sd-stats-badge {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
}

.sd-stats-count {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: #fbbf24; /* Golden */
}

.sd-stats-lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    color: #94a3b8;
}

/* Responsive Grid Layout */
.sd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* Certificate Card Individual Item */
.sd-cert-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    border-top: 4px solid #0f172a; /* Navy Top Accent */
    position: relative;
    overflow: hidden;
}

.sd-cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.sd-cert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sd-cert-icon-wrapper {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sd-cert-card:hover .sd-cert-icon-wrapper {
    background: #0f172a;
    color: #fbbf24;
}

.sd-cert-icon-wrapper .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

/* Badges Status styles */
.sd-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
}

.status-active { background-color: #10b981; }
.status-suspended { background-color: #f59e0b; }
.status-revoked { background-color: #ef4444; }

/* Certificate Card Body */
.sd-cert-card-body {
    flex-grow: 1;
    margin-bottom: 20px;
}

.sd-cert-meta-num {
    font-family: monospace;
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 12px;
}

.sd-cert-title {
    font-size: 18px;
    color: #0f172a;
    margin: 0 0 10px 0;
    font-weight: 700;
    line-height: 1.4;
}

.sd-cert-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sd-cert-title a:hover {
    color: #d97706; /* Gold */
}

.sd-cert-excerpt {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

/* Certificate Card Footer */
.sd-cert-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
}

.sd-cert-date {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sd-cert-date .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

/* Buttons Styling */
.sd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
}

.sd-btn-primary {
    background-color: #0f172a;
    color: #fff;
    padding: 12px 24px;
    font-size: 14px;
}

.sd-btn-primary:hover {
    background-color: #1e293b;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.sd-btn-accent {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
    padding: 8px 16px;
    font-size: 12px;
    box-shadow: 0 3px 8px rgba(217, 119, 6, 0.2);
}

.sd-btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(217, 119, 6, 0.35);
}

.sd-btn-small {
    border-radius: 6px;
}

/* Restricted / Login card */
.sd-login-card {
    max-width: 450px;
    margin: 50px auto;
    text-align: center;
    border-top: 4px solid #ef4444;
}

.sd-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.sd-card-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.sd-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
}

.sd-card-text {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

/* Empty Card layout */
.sd-empty-card {
    text-align: center;
    padding: 50px 30px;
    color: #64748b;
    grid-column: 1 / -1;
}

.sd-empty-card .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 15px;
}

/* ==========================================
   Verification Portal Custom Styles
   ========================================== */
.sd-verify-portal {
    max-width: 800px;
}

.sd-search-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    border-top: 4px solid #0f172a;
    text-align: center;
}

.sd-portal-title {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
}

.sd-portal-desc {
    font-size: 14px;
    color: #475569;
    max-width: 600px;
    margin: 0 auto 25px auto;
    line-height: 1.6;
}

/* Input Form */
.sd-search-form {
    margin-top: 20px;
}

.sd-search-input-group {
    display: flex;
    align-items: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    padding: 4px 6px;
    transition: all 0.3s ease;
}

.sd-search-input-group:focus-within {
    border-color: #d97706; /* Golden border */
    box-shadow: 0 4px 25px rgba(217, 119, 6, 0.15);
}

.sd-search-icon {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.sd-search-input-group input[type="text"] {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 12px 12px 45px;
    font-size: 15px;
    font-weight: 500;
    color: #0f172a;
    outline: none;
}

.sd-search-input-group input[type="text"]::placeholder {
    color: #94a3b8;
}

.sd-search-input-group .sd-btn {
    border-radius: 8px;
    padding: 12px 24px;
    white-space: nowrap;
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.sd-search-reset {
    margin-top: 15px;
}

.sd-btn-reset-link {
    font-size: 12px;
    color: #ef4444;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(239, 68, 68, 0.06);
    transition: all 0.2s ease;
}

.sd-btn-reset-link:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* ==========================================
   Verification Search Results Styles
   ========================================== */
.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.sd-result-card {
    border-top: 4px solid #10b981; /* Default green border for valid certs */
    background: #ffffff;
}

.sd-success-result {
    border-color: #10b981;
}

.sd-warning-result {
    border-color: #f59e0b;
}

.sd-error-result {
    border-color: #ef4444;
    text-align: center;
}

.sd-result-badge-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.sd-verify-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 8px 20px;
    border-radius: 50px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.valid-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.invalid-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notfound-badge {
    background: linear-gradient(135deg, #374151, #1f2937);
}

.sd-result-title {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 22px;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.sd-result-intro {
    text-align: center;
    font-size: 13px;
    color: #475569;
    max-width: 550px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

/* Detail Grid on Verification Result */
.sd-result-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.sd-detail-item {
    display: flex;
    flex-direction: column;
}

.sd-col-full {
    grid-column: span 2;
}

.sd-detail-lbl {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.sd-detail-val {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}

.sd-highlight {
    font-size: 18px;
    color: #0f172a;
    font-weight: 700;
}

.sd-detail-val code {
    font-family: monospace;
    font-size: 12px;
    background: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
    color: #0f172a;
    word-break: break-all;
}

.sd-hash {
    font-size: 11px;
    color: #64748b !important;
}

/* Result Verification Footer with QR */
.sd-result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 25px;
    gap: 30px;
}

.sd-qr-box {
    text-align: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.sd-qr-img {
    width: 110px;
    height: 110px;
    display: block;
    margin: 0 auto;
}

.sd-qr-lbl {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-top: 6px;
    display: block;
    font-weight: 600;
}

.sd-action-box {
    flex-grow: 1;
    text-align: left;
}

.sd-action-text {
    font-size: 13px;
    color: #475569;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.sd-action-box .sd-btn {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.sd-action-box .sd-btn:hover {
    background: #0f172a;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.25);
}

/* Warnings and Notes */
.sd-warning-note {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid #f59e0b;
    padding: 12px 18px;
    border-radius: 0 8px 8px 0;
    font-size: 12px;
    color: #b45309;
    line-height: 1.6;
    margin: 20px 0 0 0;
}

/* Utilities */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sd-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .sd-stats-badge {
        align-self: flex-start;
    }

    .sd-result-detail-grid {
        grid-template-columns: 1fr;
    }

    .sd-col-full {
        grid-column: span 1;
    }

    .sd-result-footer {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .sd-action-box {
        text-align: center;
    }
}
