/**
 * Namaa Certificate System - Frontend Styles
 * Unified Premium Design for Verification & Certificate Display Pages
 * Brand Colors: Teal (#1a9e8f), Gold (#e6b422)
 */

/* =====================================================
   CSS Custom Properties
   ===================================================== */
:root {
    /* Namaa Brand Colors */
    --ncs-teal: #1a9e8f;
    --ncs-teal-dark: #158074;
    --ncs-teal-light: #e8f7f5;
    --ncs-gold: #e6b422;
    --ncs-gold-dark: #c99a1a;
    --ncs-gold-light: #fef9e6;

    /* Neutrals */
    --ncs-dark: #0f172a;
    --ncs-dark-light: #1e293b;
    --ncs-text: #334155;
    --ncs-text-muted: #64748b;
    --ncs-text-light: #94a3b8;
    --ncs-border: #e2e8f0;
    --ncs-border-light: #f1f5f9;
    --ncs-white: #ffffff;
    --ncs-bg: #f8fafc;

    /* Status Colors */
    --ncs-success: #059669;
    --ncs-success-bg: #ecfdf5;
    --ncs-warning: #ca8a04;
    --ncs-warning-bg: #fefce8;
    --ncs-error: #dc2626;
    --ncs-error-bg: #fef2f2;

    /* Spacing */
    --ncs-radius: 16px;
    --ncs-radius-sm: 10px;
    --ncs-radius-xs: 6px;

    /* Shadows */
    --ncs-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --ncs-shadow-md: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --ncs-shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.12), 0 10px 20px -15px rgba(0,0,0,0.06);
    --ncs-shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);

    /* Transitions */
    --ncs-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ncs-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   Page Wrapper & Background
   ===================================================== */
.ncs-page-wrapper {
    position: relative;
    background: linear-gradient(180deg, var(--ncs-bg) 0%, var(--ncs-white) 40%, var(--ncs-white) 60%, var(--ncs-bg) 100%);
    padding: 60px 20px 100px;
    min-height: calc(100vh - 200px);
    overflow: hidden;
    font-family: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ncs-page-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ncs-bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.04;
}

.ncs-bg-circle--1 {
    width: 600px;
    height: 600px;
    background: var(--ncs-teal);
    top: -200px;
    right: -100px;
}

.ncs-bg-circle--2 {
    width: 400px;
    height: 400px;
    background: var(--ncs-gold);
    bottom: -100px;
    left: -100px;
}

.ncs-bg-circle--3 {
    width: 300px;
    height: 300px;
    background: var(--ncs-teal);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ncs-page-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
}

/* =====================================================
   Hero Section
   ===================================================== */
.ncs-hero-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 50px 30px;
    background: linear-gradient(135deg, var(--ncs-teal) 0%, var(--ncs-teal-dark) 100%);
    border-radius: var(--ncs-radius);
    position: relative;
    overflow: hidden;
    box-shadow: var(--ncs-shadow-lg);
}

.ncs-hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(230,180,34,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.ncs-hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.ncs-hero-inner {
    position: relative;
    z-index: 1;
}

.ncs-hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    margin-bottom: 20px;
    color: var(--ncs-gold);
    font-size: 32px;
    border: 2px solid rgba(255,255,255,0.2);
}

.ncs-hero-title {
    font-family: 'Cairo', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--ncs-white);
    margin: 0 0 12px;
    line-height: 1.3;
}

.ncs-hero-description {
    font-size: 17px;
    color: rgba(255,255,255,0.85);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* =====================================================
   Verification Card
   ===================================================== */
.ncs-verify-card {
    background: var(--ncs-white);
    border-radius: var(--ncs-radius);
    box-shadow: var(--ncs-shadow-md);
    border: 1px solid var(--ncs-border);
    margin-bottom: 40px;
    overflow: hidden;
    transition: var(--ncs-transition);
}

.ncs-verify-card:hover {
    box-shadow: var(--ncs-shadow-lg);
}

.ncs-verify-card__header {
    text-align: center;
    padding: 36px 30px 28px;
    background: linear-gradient(180deg, var(--ncs-teal-light) 0%, var(--ncs-white) 100%);
    border-bottom: 1px solid var(--ncs-border-light);
}

.ncs-verify-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--ncs-teal) 0%, var(--ncs-teal-dark) 100%);
    border-radius: 50%;
    color: var(--ncs-white);
    font-size: 26px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(26,158,143,0.3);
}

.ncs-verify-card__icon.ncs-icon--error {
    background: linear-gradient(135deg, var(--ncs-error) 0%, #b91c1c 100%);
    box-shadow: 0 8px 20px rgba(220,38,38,0.3);
}

.ncs-verify-card__title {
    font-family: 'Cairo', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--ncs-dark);
    margin: 0 0 6px;
}

.ncs-verify-card__subtitle {
    font-size: 15px;
    color: var(--ncs-text-muted);
    margin: 0;
}

.ncs-verify-card__body {
    padding: 30px;
}

/* =====================================================
   Input Wrapper
   ===================================================== */
.ncs-input-wrapper {
    display: flex;
    align-items: stretch;
    background: var(--ncs-bg);
    border: 2px solid var(--ncs-border);
    border-radius: var(--ncs-radius-sm);
    overflow: hidden;
    transition: var(--ncs-transition);
}

.ncs-input-wrapper:focus-within {
    border-color: var(--ncs-teal);
    background: var(--ncs-white);
    box-shadow: 0 0 0 4px rgba(26,158,143,0.1);
}

.ncs-input-wrapper--compact {
    flex: 1;
    max-width: 500px;
}

.ncs-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: var(--ncs-text-light);
    font-size: 20px;
    background: rgba(0,0,0,0.02);
}

.ncs-verify-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 16px;
    font-size: 16px;
    font-family: 'Inter', monospace;
    color: var(--ncs-dark);
    outline: none;
    min-width: 0;
    letter-spacing: 0.5px;
}

.ncs-verify-input::placeholder {
    color: var(--ncs-text-light);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0;
}

.ncs-verify-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--ncs-teal) 0%, var(--ncs-teal-dark) 100%);
    color: var(--ncs-white);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ncs-transition);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.ncs-verify-button:hover {
    background: linear-gradient(135deg, var(--ncs-teal-dark) 0%, #0f665d 100%);
}

.ncs-verify-button:active {
    transform: scale(0.98);
}

.ncs-verify-button--compact {
    padding: 14px 20px;
}

.ncs-btn-loader .dashicons {
    animation: ncsSpin 1s linear infinite;
}

.ncs-format-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--ncs-gold-light);
    border-radius: var(--ncs-radius-xs);
    font-size: 13px;
    color: var(--ncs-gold-dark);
}

.ncs-format-hint .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* =====================================================
   Info Cards Grid
   ===================================================== */
.ncs-info-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ncs-info-card {
    background: var(--ncs-white);
    border-radius: var(--ncs-radius-sm);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--ncs-shadow);
    border: 1px solid var(--ncs-border);
    transition: var(--ncs-transition);
}

.ncs-info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ncs-shadow-md);
}

.ncs-info-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 24px;
    margin-bottom: 16px;
}

/* Ensure dashicons inside info card icons are properly rendered. */
.ncs-info-card__icon .dashicons {
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 1 !important;
    color: inherit !important;
}

.ncs-info-card__title {
    font-family: 'Cairo', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--ncs-dark);
    margin: 0 0 8px;
}

.ncs-info-card__text {
    font-size: 14px;
    color: var(--ncs-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* =====================================================
   Certificate Card
   ===================================================== */
.ncs-certificate-card {
    background: var(--ncs-white);
    border-radius: 20px;
    box-shadow: var(--ncs-shadow-xl);
    border: 1px solid var(--ncs-border);
    overflow: hidden;
    transition: var(--ncs-transition);
}

.ncs-certificate-card:hover {
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.18), 0 15px 30px -20px rgba(0,0,0,0.1);
}

/* Certificate Header */
.ncs-cert-header {
    position: relative;
    background: linear-gradient(135deg, var(--ncs-teal) 0%, #0f7a6f 40%, var(--ncs-dark) 100%);
    padding: 56px 40px 48px;
    text-align: center;
    overflow: hidden;
}

.ncs-cert-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ncs-gold) 0%, #f5d560 50%, var(--ncs-gold) 100%);
}

.ncs-cert-header__decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ncs-cert-header__circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: var(--ncs-white);
}

.ncs-cert-header__circle--1 {
    width: 400px;
    height: 400px;
    top: -150px;
    right: -100px;
}

.ncs-cert-header__circle--2 {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -80px;
}

.ncs-cert-header__circle--3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.03;
}

.ncs-cert-header__content {
    position: relative;
    z-index: 1;
}

.ncs-cert-header__logo-wrapper {
    margin-bottom: 24px;
}

.ncs-cert-header__logo {
    max-height: 140px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
    transition: transform 0.4s ease;
}

.ncs-certificate-card:hover .ncs-cert-header__logo {
    transform: scale(1.03);
}

.ncs-cert-header__title {
    font-family: 'Cairo', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--ncs-gold);
    margin: 0 0 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.ncs-cert-header__subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    margin: 0 0 24px;
}

.ncs-cert-header__code {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(230,180,34,0.3);
    border-radius: 50px;
    color: var(--ncs-gold);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1.5px;
}

.ncs-cert-header__code .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Status Banner */
.ncs-cert-status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.ncs-cert-status-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.05;
    background: repeating-linear-gradient(
        -45deg,
        currentColor,
        currentColor 1px,
        transparent 1px,
        transparent 8px
    );
}

.ncs-cert-status-banner .dashicons {
    position: relative;
    z-index: 1;
}

.ncs-cert-status-banner__text {
    position: relative;
    z-index: 1;
}

.ncs-cert-status-banner__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    position: relative;
    z-index: 1;
    animation: ncsPulse 2s ease-in-out infinite;
}

.ncs-status--issued {
    background: var(--ncs-success-bg);
    color: var(--ncs-success);
}

.ncs-status--pending {
    background: var(--ncs-warning-bg);
    color: var(--ncs-warning);
}

.ncs-status--revoked {
    background: var(--ncs-error-bg);
    color: var(--ncs-error);
}

/* Certificate Body */
.ncs-cert-body {
    padding: 44px 44px 36px;
}

/* Certificate Section (used on verification page) */
.ncs-cert-section {
    margin-bottom: 32px;
}

.ncs-cert-section__header {
    text-align: center;
    margin-bottom: 28px;
}

.ncs-cert-section__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ncs-teal), var(--ncs-teal-dark));
    color: var(--ncs-white);
    margin-bottom: 12px;
}

.ncs-cert-section__icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    line-height: 1;
}

.ncs-cert-section__title {
    font-family: 'Cairo', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--ncs-dark);
    margin: 0 0 6px 0;
}

.ncs-cert-section__subtitle {
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    color: var(--ncs-text-muted);
    margin: 0;
}

/* Holder Section */
.ncs-cert-holder {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 40px;
}

.ncs-cert-holder__photo-wrapper {
    position: relative;
    flex-shrink: 0;
}

.ncs-cert-holder__photo-ring {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--ncs-teal) 0%, var(--ncs-gold) 100%);
    box-shadow: 0 8px 24px rgba(26,158,143,0.2), 0 4px 12px rgba(0,0,0,0.08);
}

.ncs-cert-holder__photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ncs-white);
    display: block;
}

.ncs-cert-holder__photo-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    background: var(--ncs-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ncs-white);
    font-size: 14px;
    border: 3px solid var(--ncs-white);
    box-shadow: var(--ncs-shadow);
}

.ncs-cert-holder__info {
    flex: 1;
    min-width: 0;
}

.ncs-cert-holder__name-group {
    margin-bottom: 28px;
}

.ncs-cert-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ncs-text-light);
    font-weight: 700;
    margin-bottom: 8px;
}

.ncs-cert-holder__name {
    font-family: 'Cairo', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--ncs-dark);
    margin: 0 0 4px;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--ncs-dark) 0%, var(--ncs-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ncs-cert-holder__name-ar {
    font-family: 'Cairo', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--ncs-text);
    margin: 0;
}

/* Details Grid */
.ncs-cert-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ncs-cert-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 16px;
    background: linear-gradient(135deg, var(--ncs-bg) 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1.5px solid var(--ncs-border-light);
    transition: var(--ncs-transition);
    position: relative;
    overflow: hidden;
}

.ncs-cert-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ncs-teal), var(--ncs-gold));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ncs-cert-detail:hover {
    background: var(--ncs-white);
    border-color: var(--ncs-teal);
    box-shadow: 0 4px 16px rgba(26,158,143,0.12);
    transform: translateY(-2px);
}

.ncs-cert-detail:hover::before {
    opacity: 1;
}

.ncs-cert-detail__icon {
    color: var(--ncs-teal);
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.ncs-cert-detail:hover .ncs-cert-detail__icon {
    transform: scale(1.2);
}

.ncs-cert-detail__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--ncs-text-light);
    font-weight: 700;
}

.ncs-cert-detail__value {
    font-size: 15px;
    font-weight: 600;
    color: var(--ncs-dark);
    line-height: 1.4;
    word-break: break-word;
}

/* Language icon override */
.ncs-lang-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ncs-teal);
    transition: transform 0.3s ease;
}
.ncs-cert-detail:hover .ncs-lang-icon {
    transform: scale(1.2);
}
.ncs-lang-icon svg {
    width: 18px;
    height: 18px;
}

/* Divider */
.ncs-cert-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 0;
    margin: 0 0 40px;
    position: relative;
    color: var(--ncs-gold);
    font-size: 14px;
}

.ncs-cert-divider::before,
.ncs-cert-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ncs-border), transparent);
}

.ncs-cert-divider .dashicons {
    animation: ncsSpin 8s linear infinite;
}

/* Documents Section */
.ncs-cert-documents {
    margin-top: 10px;
}

.ncs-cert-documents__title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--ncs-dark);
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ncs-border);
    position: relative;
}

.ncs-cert-documents__title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--ncs-teal), var(--ncs-gold));
    border-radius: 2px;
}

.ncs-cert-documents__title .dashicons {
    color: var(--ncs-teal);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ncs-cert-documents__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Document Card Base */
.ncs-cert-doc-card {
    display: flex;
    flex-direction: column;
    background: var(--ncs-white);
    border: 1px solid var(--ncs-border);
    border-radius: var(--ncs-radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.ncs-cert-doc-card:hover {
    border-color: var(--ncs-teal);
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(26, 158, 143, 0.15), 0 4px 12px rgba(0,0,0,0.06);
}

/* Preview Area - Image */
.ncs-cert-doc-card__preview--image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--ncs-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ncs-cert-doc-card__preview--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ncs-cert-doc-card:hover .ncs-cert-doc-card__preview--image img {
    transform: scale(1.05);
}

/* Preview Area - PDF */
.ncs-cert-doc-card__preview--pdf {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--ncs-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ncs-transition);
}

.ncs-cert-doc-card__preview--pdf:hover {
    background: linear-gradient(135deg, var(--ncs-teal-light) 0%, rgba(26, 158, 143, 0.08) 100%);
}

.ncs-cert-doc-card__pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ncs-cert-doc-card__pdf-icon {
    font-size: 56px;
    width: 56px;
    height: 56px;
    color: #dc3545;
    opacity: 0.7;
    transition: var(--ncs-transition);
}

.ncs-cert-doc-card__preview--pdf:hover .ncs-cert-doc-card__pdf-icon {
    opacity: 1;
    transform: scale(1.1);
}

.ncs-cert-doc-card__pdf-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ncs-text-muted);
    padding: 6px 16px;
    background: var(--ncs-white);
    border: 1px solid var(--ncs-border);
    border-radius: 20px;
    transition: var(--ncs-transition);
}

.ncs-cert-doc-card__preview--pdf:hover .ncs-cert-doc-card__pdf-label {
    background: var(--ncs-teal);
    color: var(--ncs-white);
    border-color: var(--ncs-teal);
}

/* PDF Modal */
.ncs-pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ncsFadeIn 0.3s ease;
}

.ncs-pdf-modal.is-active {
    display: flex;
}

.ncs-pdf-modal__content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background: var(--ncs-white);
    border-radius: var(--ncs-radius);
    overflow: hidden;
    box-shadow: var(--ncs-shadow-xl);
    animation: ncsScaleIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Mobile: make PDF modal take full screen */
@media (max-width: 768px) {
    .ncs-pdf-modal {
        padding: 0;
    }

    .ncs-pdf-modal__content {
        width: 100%;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }
}

.ncs-pdf-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--ncs-dark);
    color: var(--ncs-white);
    flex-shrink: 0;
}

.ncs-pdf-modal__title {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 16px;
}

.ncs-pdf-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--ncs-white);
    cursor: pointer;
    transition: var(--ncs-transition);
    flex-shrink: 0;
    border: none;
}

.ncs-pdf-modal__close:hover {
    background: var(--ncs-error);
}

.ncs-pdf-modal__close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ncs-pdf-modal__body {
    flex: 1;
    background: #525659;
}

.ncs-pdf-modal__body embed {
    width: 100%;
    height: 100%;
    border: none;
}

/* Text File Preview Card */
.ncs-cert-doc-card__preview--text {
    position: relative;
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    background: var(--ncs-dark);
    border-bottom: 1px solid var(--ncs-border);
    cursor: pointer;
}

.ncs-cert-doc-card__preview--text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, var(--ncs-dark), transparent);
    pointer-events: none;
    z-index: 1;
}

.ncs-cert-doc-card__preview--text .ncs-cert-doc-card__text-content {
    margin: 0;
    padding: 16px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
    max-height: 200px;
    overflow: hidden;
}

.ncs-cert-doc-card__text-more {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--ncs-teal);
    color: var(--ncs-white);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--ncs-transition);
    box-shadow: 0 4px 12px rgba(26, 158, 143, 0.3);
}

.ncs-cert-doc-card__text-more:hover {
    background: var(--ncs-teal-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 158, 143, 0.4);
}

.ncs-cert-doc-card__text-more .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Text Modal */
.ncs-text-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ncs-text-modal.is-active {
    display: flex;
}

.ncs-text-modal__content {
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--ncs-white);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ncsScaleIn 0.3s ease;
}

.ncs-text-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--ncs-teal) 0%, var(--ncs-teal-dark) 100%);
    color: var(--ncs-white);
}

.ncs-text-modal__title {
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 16px;
}

.ncs-text-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: var(--ncs-white);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--ncs-transition);
    flex-shrink: 0;
}

.ncs-text-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ncs-text-modal__close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ncs-text-modal__body {
    flex: 1;
    overflow: auto;
    background: var(--ncs-dark);
    padding: 0;
}

.ncs-text-modal__pre {
    margin: 0;
    padding: 24px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
}

.ncs-text-modal__body::-webkit-scrollbar {
    width: 8px;
}

.ncs-text-modal__body::-webkit-scrollbar-track {
    background: var(--ncs-dark-light);
}

.ncs-text-modal__body::-webkit-scrollbar-thumb {
    background: var(--ncs-teal);
    border-radius: 4px;
}

/* Preview Area - Video */
.ncs-cert-doc-card__preview--video {
    width: 100%;
    background: #000;
    border-bottom: 1px solid var(--ncs-border);
}

.ncs-cert-doc-card__preview--video video {
    width: 100%;
    max-height: 250px;
    display: block;
}

/* Preview Area - Audio */
.ncs-cert-doc-card__preview--audio {
    width: 100%;
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--ncs-teal-light) 0%, rgba(26, 158, 143, 0.05) 100%);
    border-bottom: 1px solid var(--ncs-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ncs-cert-doc-card__audio-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.ncs-cert-doc-card__audio-icon {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: var(--ncs-teal);
    flex-shrink: 0;
}

.ncs-cert-doc-card__audio-wrapper audio {
    flex: 1;
    height: 40px;
}

/* Media elements */
.ncs-cert-doc-card__media {
    width: 100%;
}

/* Info Bar */
.ncs-cert-doc-card__info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--ncs-white);
}

.ncs-cert-doc-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ncs-teal-light) 0%, rgba(26, 158, 143, 0.08) 100%);
    flex-shrink: 0;
}

.ncs-cert-doc-card__icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--ncs-teal);
}

.ncs-cert-doc-card--pdf .ncs-cert-doc-card__icon {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
}

.ncs-cert-doc-card--pdf .ncs-cert-doc-card__icon .dashicons {
    color: #dc3545;
}

.ncs-cert-doc-card--video .ncs-cert-doc-card__icon {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.12) 0%, rgba(108, 117, 125, 0.06) 100%);
}

.ncs-cert-doc-card--video .ncs-cert-doc-card__icon .dashicons {
    color: #6c757d;
}

.ncs-cert-doc-card--audio .ncs-cert-doc-card__icon {
    background: linear-gradient(135deg, rgba(230, 180, 34, 0.12) 0%, rgba(230, 180, 34, 0.06) 100%);
}

.ncs-cert-doc-card--audio .ncs-cert-doc-card__icon .dashicons {
    color: #e6b422;
}

.ncs-cert-doc-card__name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--ncs-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ncs-cert-doc-card__download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--ncs-text-muted);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ncs-cert-doc-card__download:hover {
    background: var(--ncs-teal-light);
    color: var(--ncs-teal);
}

.ncs-cert-doc-card__download .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Preview Area - Generic File (no preview available) */
.ncs-cert-doc-card__preview--generic {
    width: 100%;
    padding: 32px 20px;
    background: linear-gradient(135deg, var(--ncs-bg) 0%, var(--ncs-border-light) 100%);
    border-bottom: 1px solid var(--ncs-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ncs-cert-doc-card__generic-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--ncs-text-light);
    opacity: 0.4;
}

.ncs-cert-doc-card__generic-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ncs-text-light);
    padding: 6px 16px;
    background: var(--ncs-white);
    border: 1px dashed var(--ncs-border);
    border-radius: 20px;
}

/* Text file icon color */
.ncs-cert-doc-card--text .ncs-cert-doc-card__icon {
    background: linear-gradient(135deg, var(--ncs-dark) 0%, var(--ncs-dark-light) 100%);
}

.ncs-cert-doc-card--text .ncs-cert-doc-card__icon .dashicons {
    color: var(--ncs-gold);
}

/* Certificate Footer */
.ncs-cert-footer {
    background: linear-gradient(135deg, var(--ncs-bg) 0%, #f1f5f9 100%);
    border-top: 2px solid var(--ncs-border);
    padding: 28px 40px;
    position: relative;
}

.ncs-cert-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ncs-teal), var(--ncs-gold), var(--ncs-teal));
}

.ncs-cert-footer__content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ncs-cert-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--ncs-transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.ncs-cert-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.ncs-cert-action:hover::before {
    left: 100%;
}

.ncs-cert-action .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ncs-cert-action--primary {
    background: linear-gradient(135deg, var(--ncs-gold) 0%, var(--ncs-gold-dark) 100%);
    color: var(--ncs-white);
    box-shadow: 0 4px 12px rgba(230,180,34,0.3);
}

.ncs-cert-action--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(230,180,34,0.4);
}

.ncs-cert-action--secondary {
    background: var(--ncs-white);
    color: var(--ncs-teal);
    border-color: var(--ncs-teal);
}

.ncs-cert-action--secondary:hover {
    background: var(--ncs-teal);
    color: var(--ncs-white);
    transform: translateY(-2px);
}

.ncs-cert-action--admin {
    background: var(--ncs-white);
    color: var(--ncs-text-muted);
    border-color: var(--ncs-border);
    font-size: 13px;
    padding: 10px 20px;
}

.ncs-cert-action--admin:hover {
    border-color: var(--ncs-text-muted);
    color: var(--ncs-dark);
}

/* =====================================================
   Search Another (Error Card)
   ===================================================== */
.ncs-search-another {
    margin-bottom: 20px;
}

.ncs-search-another p {
    font-size: 15px;
    color: var(--ncs-text-muted);
    margin: 0 0 14px;
    font-weight: 500;
}

/* =====================================================
   AJAX Result States
   ===================================================== */
.ncs-verify-result {
    padding: 0 30px 30px;
}

.ncs-loading-state {
    text-align: center;
    padding: 30px;
    color: var(--ncs-text-muted);
}

.ncs-pulse {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--ncs-border);
    border-top-color: var(--ncs-teal);
    border-radius: 50%;
    animation: ncsSpin 0.8s linear infinite;
    margin-bottom: 12px;
}

/* Valid Result Card */
.ncs-verify-valid-card {
    background: var(--ncs-white);
    border-radius: var(--ncs-radius-sm);
    border: 1px solid var(--ncs-border);
    overflow: hidden;
    margin-top: 10px;
    box-shadow: var(--ncs-shadow);
}

.ncs-result-status-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--ncs-success-bg);
    border-bottom: 1px solid #d1fae5;
}

.ncs-status-icon {
    width: 48px;
    height: 48px;
    background: var(--ncs-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ncs-white);
    font-size: 24px;
    flex-shrink: 0;
}

.ncs-status-title {
    font-family: 'Cairo', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--ncs-success);
}

.ncs-status-subtitle {
    font-size: 14px;
    color: var(--ncs-text-muted);
    margin-top: 2px;
}

.ncs-result-main-grid {
    display: flex;
    gap: 24px;
    padding: 24px;
}

.ncs-result-details-panel {
    flex: 1;
    min-width: 0;
}

.ncs-result-group {
    margin-bottom: 20px;
}

.ncs-result-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ncs-text-light);
    font-weight: 700;
    margin-bottom: 6px;
}

.ncs-result-holder-name {
    font-family: 'Cairo', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--ncs-dark);
    margin: 0 0 4px;
}

.ncs-result-holder-name-ar {
    font-family: 'Cairo', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--ncs-text);
    margin: 0;
    direction: rtl;
}

.ncs-result-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ncs-result-item {
    padding: 12px;
    background: var(--ncs-bg);
    border-radius: var(--ncs-radius-xs);
    border: 1px solid var(--ncs-border-light);
}

.ncs-result-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ncs-dark);
    margin-top: 4px;
}

.ncs-result-photo-panel {
    flex-shrink: 0;
    text-align: center;
}

.ncs-result-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ncs-white);
    box-shadow: var(--ncs-shadow-md);
}

.ncs-photo-caption {
    font-size: 12px;
    color: var(--ncs-text-light);
    margin-top: 8px;
    font-weight: 600;
}

.ncs-result-actions {
    padding: 0 24px 24px;
    display: flex;
    justify-content: center;
}

/* Invalid Result */
.ncs-verify-invalid {
    text-align: center;
    padding: 30px;
    background: var(--ncs-error-bg);
    border-radius: var(--ncs-radius-sm);
    border: 1px solid #fecaca;
}

.ncs-verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--ncs-error);
    color: var(--ncs-white);
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
}

.ncs-verify-badge .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ncs-verify-invalid p {
    color: var(--ncs-text-muted);
    margin: 0;
    font-size: 14px;
}

/* =====================================================
   Gold Button (Shared)
   ===================================================== */
.button-gold {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--ncs-gold) 0%, var(--ncs-gold-dark) 100%) !important;
    color: var(--ncs-white) !important;
    border: none !important;
    border-radius: 50px !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: var(--ncs-transition);
    box-shadow: 0 4px 12px rgba(230,180,34,0.3);
    cursor: pointer;
}

.button-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(230,180,34,0.4);
    color: var(--ncs-white) !important;
}

/* =====================================================
   Animations
   ===================================================== */
@keyframes ncsSpin {
    to { transform: rotate(360deg); }
}

@keyframes ncsPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

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

@keyframes ncsScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.ncs-verify-card {
    animation: ncsFadeIn 0.5s ease-out;
}

.ncs-certificate-card {
    animation: ncsScaleIn 0.5s ease-out;
}

.ncs-info-card:nth-child(1) { animation: ncsFadeIn 0.4s ease-out 0.1s both; }
.ncs-info-card:nth-child(2) { animation: ncsFadeIn 0.4s ease-out 0.2s both; }
.ncs-info-card:nth-child(3) { animation: ncsFadeIn 0.4s ease-out 0.3s both; }

/* =====================================================
   RTL Support
   ===================================================== */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .ncs-cert-holder {
    flex-direction: row-reverse;
}

.rtl .ncs-cert-documents__title::after {
    left: auto;
    right: 0;
}

.rtl .ncs-result-main-grid {
    flex-direction: row-reverse;
}

/* =====================================================
   Responsive Design
   ===================================================== */
@media (max-width: 768px) {
    .ncs-page-wrapper {
        padding: 20px 12px 60px;
    }

    .ncs-hero-section {
        padding: 36px 20px;
    }

    .ncs-hero-title {
        font-size: 26px;
    }

    .ncs-hero-description {
        font-size: 15px;
    }

    .ncs-info-cards-grid {
        grid-template-columns: 1fr;
    }

    .ncs-verify-card__header {
        padding: 28px 20px 24px;
    }

    .ncs-verify-card__body {
        padding: 20px;
    }

    .ncs-input-wrapper {
        flex-direction: column;
    }

    .ncs-verify-button {
        width: 100%;
        justify-content: center;
        padding: 16px;
    }

    .ncs-cert-header {
        padding: 36px 20px;
    }

    .ncs-cert-header__title {
        font-size: 24px;
    }

    .ncs-cert-body {
        padding: 24px 20px;
    }

    .ncs-cert-holder {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rtl .ncs-cert-holder {
        flex-direction: column;
    }

    .ncs-cert-details-grid {
        grid-template-columns: 1fr;
    }

    .ncs-cert-footer__content {
        flex-direction: column;
    }

    .ncs-cert-action {
        justify-content: center;
    }

    .ncs-result-main-grid {
        flex-direction: column;
    }

    .rtl .ncs-result-main-grid {
        flex-direction: column;
    }

    .ncs-result-info-grid {
        grid-template-columns: 1fr;
    }

    .ncs-input-wrapper--compact {
        max-width: 100%;
    }

    .ncs-verify-result {
        padding: 0 20px 20px;
    }

    .ncs-cert-documents__grid {
        grid-template-columns: 1fr;
    }
}

/* GLightbox Customization — Namaa Brand */
.glightbox-container .gslide .ginner-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a9e8f, #e6b422, #1a9e8f);
    z-index: 10;
}

.glightbox-container .gbtn {
    color: #fff;
    transition: all 0.3s ease;
}

.glightbox-container .gbtn:hover {
    color: #1a9e8f;
    transform: scale(1.1);
}

.glightbox-container .gcounter {
    font-family: 'Cairo', sans-serif;
    color: rgba(255,255,255,0.7);
}

/* Ensure doc cards work as GLightbox triggers */
.ncs-cert-doc-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: var(--ncs-transition);
}

.ncs-cert-doc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ncs-shadow-md);
}
