:root {
    --primary-dark: #0D3B4C;
    --primary-blue: #1D85B8;
    --primary-teal: #3DB3BC;
    --white: #FFFFFF;
    --bg-gradient: linear-gradient(135deg, #0D3B4C 0%, #1D85B8 50%, #3DB3BC 100%);
    --shadow: 0 10px 40px rgba(13, 59, 76, 0.2);
    --shadow-lg: 0 20px 60px rgba(13, 59, 76, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Inter', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(61, 179, 188, 0.15) 0%, transparent 70%);
    animation: float 15s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(29, 133, 184, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.container {
    width: 100%;
    max-width: 580px;
    position: relative;
    z-index: 1;
}

/* Language Toggle */
.lang-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 100;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 180px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.title {
    color: var(--white);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
}

/* Search Section */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', 'Inter', sans-serif;
    font-size: 15px;
    direction: ltr;
    text-align: left;
    transition: all 0.3s ease;
    outline: none;
    background: #f8fafc;
}

.search-input:focus {
    border-color: var(--primary-teal);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(61, 179, 188, 0.1);
}

.search-input::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    background: var(--bg-gradient);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(29, 133, 184, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.search-hint {
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--white);
}

.loading p {
    margin-top: 16px;
    font-size: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result */
.result {
    margin-top: 24px;
    animation: slideUp 0.5s ease;
}

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

.result-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Success Result */
.result-card.success {
    border-top: 4px solid #10b981;
}

.result-card.error {
    border-top: 4px solid #ef4444;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.success .status-icon {
    background: #dcfce7;
    color: #16a34a;
}

.error .status-icon {
    background: #fee2e2;
    color: #dc2626;
}

.status-text h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.status-text p {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.result-details {
    display: grid;
    gap: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.detail-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.detail-value {
    font-size: 14px;
    color: var(--primary-dark);
    font-weight: 700;
    direction: ltr;
}

.cert-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-active {
    background: #dcfce7;
    color: #16a34a;
}

.badge-expired {
    background: #fef3c7;
    color: #d97706;
}

.badge-revoked {
    background: #fee2e2;
    color: #dc2626;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        max-width: 100%;
    }

    .header {
        margin-bottom: 28px;
    }

    .logo {
        width: 140px;
    }

    .title {
        font-size: 22px;
    }

    .subtitle {
        font-size: 14px;
    }

    .search-section {
        padding: 24px 20px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-btn {
        justify-content: center;
    }

    .detail-row {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .lang-toggle {
        top: 12px;
        left: 12px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* LTR mode */
body.ltr {
    direction: ltr;
}

body.ltr .search-input {
    direction: ltr;
    text-align: left;
}

body.ltr .lang-toggle {
    left: auto;
    right: 20px;
}
