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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #1a1412 0%, #2d2416 50%, #1a1412 100%);
    background-size: 100% 200%;
    color: white;
    direction: rtl;
    overflow: hidden;
    animation: backgroundShift 30s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 0% 100%;
    }
}

.display-container {
    min-height: 100vh;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header & Logo */
.display-header {
    background: linear-gradient(135deg, #1a1412 0%, #2d2416 50%, #1a1412 100%);
    border-bottom: 5px solid #D4AF37;
    border-top: 3px solid rgba(212, 175, 55, 0.3);
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.4), inset 0 -2px 30px rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
}

.display-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.15) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmerSafe 8s infinite linear;
}

@keyframes shimmerSafe {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.logo-section {
    position: relative;
    z-index: 1;
    display: inline-block;
}

.logo-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 180%;
    background: radial-gradient(ellipse at center, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.7) 20%, 
        rgba(255, 255, 255, 0.5) 35%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.15) 65%,
        rgba(255, 255, 255, 0.05) 80%,
        transparent 100%);
    z-index: -1;
    pointer-events: none;
}

.company-logo-img {
    max-width: 650px;
    max-height: 180px;
    height: auto;
    filter: drop-shadow(0 8px 30px rgba(212, 175, 55, 0.6)) drop-shadow(0 0 50px rgba(212, 175, 55, 0.4));
    object-fit: contain;
    position: relative;
    z-index: 2;
}

.company-logo-text {
    font-size: 72px;
    font-weight: 900;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}


/* News Ticker */
.news-ticker-container {
    background: linear-gradient(90deg, #B8860B 0%, #D4AF37 50%, #B8860B 100%);
    background-size: 200% 100%;
    padding: 18px 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    animation: gradientMove 5s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.news-ticker {
    width: 100%;
    overflow: hidden;
    position: relative;
    direction: ltr;
}

.news-content {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-left-to-right var(--news-speed, 120s) linear infinite;
    font-size: 24px;
    font-weight: 600;
    will-change: transform;
    direction: rtl;
}

@keyframes scroll-left-to-right {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Rates Display */
.rates-display {
    flex: 1;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rates-table-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

.rates-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: linear-gradient(135deg, #0f0e0c 0%, #1a1412 50%, #0f0e0c 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.4), inset 0 0 60px rgba(212, 175, 55, 0.05);
    border: 3px solid #D4AF37;
    animation: tablePulse 4s ease-in-out infinite;
}

@keyframes tablePulse {
    0%, 100% {
        box-shadow: 0 20px 60px rgba(212, 175, 55, 0.4), inset 0 0 60px rgba(212, 175, 55, 0.05);
    }
    50% {
        box-shadow: 0 25px 90px rgba(212, 175, 55, 0.7), inset 0 0 80px rgba(212, 175, 55, 0.1);
    }
}

.rates-table thead {
    background: linear-gradient(135deg, #B8860B 0%, #D4AF37 50%, #B8860B 100%);
    background-size: 200% 100%;
    animation: headerGlow 4s ease infinite;
}

@keyframes headerGlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.rates-table thead tr th {
    padding: 30px 20px;
    font-size: 42px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    border-bottom: 4px solid #0f0e0c;
    color: #0f0e0c;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

.rates-table tbody tr {
    transition: all 0.5s ease;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.rates-table tbody tr:nth-child(odd) {
    animation: rowGlow 6s ease-in-out infinite;
}

.rates-table tbody tr:nth-child(even) {
    animation: rowGlow 6s ease-in-out infinite;
    animation-delay: 3s;
}

@keyframes rowGlow {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(212, 175, 55, 0.08);
    }
}

.rates-table tbody tr:nth-child(1) {
    animation-delay: 0s;
}

.rates-table tbody tr:nth-child(2) {
    animation-delay: 1s;
}

.rates-table tbody tr:nth-child(3) {
    animation-delay: 2s;
}

.rates-table tbody tr:nth-child(4) {
    animation-delay: 3s;
}

.rates-table tbody tr:nth-child(5) {
    animation-delay: 4s;
}

.rates-table tbody tr:last-child {
    border-bottom: none;
}

.rates-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.12);
}

.rates-table tbody tr.updated {
    animation: rowPulseGold 0.8s ease;
    background: rgba(212, 175, 55, 0.3);
}

@keyframes rowPulseGold {
    0%, 100% {
        transform: scale(1);
        background: rgba(212, 175, 55, 0.2);
        box-shadow: inset 0 0 0 rgba(212, 175, 55, 0);
    }
    50% {
        transform: scale(1.03);
        background: rgba(212, 175, 55, 0.4);
        box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.5);
    }
}

.rates-table tbody td {
    padding: 40px 20px;
    text-align: center;
    font-size: 52px;
    font-weight: 700;
}

.currency-col {
    width: 40%;
}

.rate-col {
    width: 30%;
}

.rates-table tbody .currency-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.currency-name-display {
    font-size: 42px;
    font-weight: 700;
    color: white;
    animation: textGlow 4s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 25px rgba(212, 175, 55, 0.4);
    }
}

.currency-code-display {
    font-size: 36px;
    font-weight: 600;
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.15);
    padding: 10px 26px;
    border-radius: 12px;
    border: 2px solid rgba(212, 175, 55, 0.5);
    animation: codePulse 4s ease-in-out infinite;
}

@keyframes codePulse {
    0%, 100% {
        border-color: rgba(212, 175, 55, 0.5);
        box-shadow: 0 0 0 rgba(212, 175, 55, 0);
    }
    50% {
        border-color: rgba(212, 175, 55, 1);
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
    }
}

.buy-rate {
    color: #10b981;
    font-size: 72px;
    font-weight: 900;
    text-shadow: 0 4px 20px rgba(16, 185, 129, 0.6);
    animation: numberGlow 4s ease-in-out infinite;
}

.sell-rate {
    color: #ef4444;
    font-size: 72px;
    font-weight: 900;
    text-shadow: 0 4px 20px rgba(239, 68, 68, 0.6);
    animation: numberGlow 4s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes numberGlow {
    0%, 100% {
        text-shadow: 0 4px 20px currentColor;
    }
    50% {
        text-shadow: 0 4px 30px currentColor, 0 0 40px currentColor;
    }
}

/* Last Update */
.last-update {
    text-align: center;
    margin-top: 40px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    animation: fadeInOut 5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(45, 36, 22, 0.9));
    padding: 12px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: blink 2s ease infinite, dotPulse 3s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px #10b981;
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 20px #10b981, 0 0 30px rgba(16, 185, 129, 0.5);
    }
}

.connection-status.disconnected .status-dot {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

.connection-status.disconnected .status-text::after {
    content: ' - محاولة إعادة الاتصال...';
}

/* No Data */
.no-currencies {
    text-align: center;
    padding: 100px 20px;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.5);
}

.rates-table tbody .no-data-row td {
    padding: 80px 20px;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.5);
}

/* Portrait Orientation Optimization */
@media (orientation: portrait) {
    .logo-section::before {
        width: 150%;
        height: 200%;
    }
    
    .company-logo-img {
        max-width: 750px;
        max-height: 220px;
    }
    
    .company-logo-text {
        font-size: 96px;
    }
    
    .rates-table thead tr th {
        font-size: 52px;
        padding: 40px 20px;
    }
    
    .rates-table tbody td {
        padding: 45px 20px;
        font-size: 60px;
    }
    
    .currency-name-display {
        font-size: 52px;
    }
    
    .currency-code-display {
        font-size: 44px;
        padding: 12px 28px;
    }
    
    .buy-rate {
        font-size: 88px;
    }
    
    .sell-rate {
        font-size: 88px;
    }
}

/* Large Screens (TV) */
@media (min-width: 1200px) {
    .display-header {
        padding: 60px 20px;
    }
    
    .logo-section::before {
        width: 160%;
        height: 220%;
    }
    
    .company-logo-img {
        max-width: 900px;
        max-height: 250px;
    }
    
    .company-logo-text {
        font-size: 120px;
    }
    
    .news-content {
        font-size: 32px;
    }
    
    .rates-table thead tr th {
        font-size: 56px;
        padding: 45px 30px;
    }
    
    .rates-table tbody td {
        padding: 55px 30px;
        font-size: 68px;
    }
    
    .currency-name-display {
        font-size: 60px;
    }
    
    .currency-code-display {
        font-size: 50px;
        padding: 14px 34px;
    }
    
    .buy-rate {
        font-size: 108px;
    }
    
    .sell-rate {
        font-size: 108px;
    }
}

/* Small Screens */
@media (max-width: 768px) {
    .logo-section::before {
        width: 130%;
        height: 160%;
    }
    
    .company-logo-img {
        max-width: 350px;
        max-height: 140px;
    }
    
    .company-logo-text {
        font-size: 56px;
    }
    
    .news-content {
        font-size: 18px;
    }
    
    .rates-table thead tr th {
        font-size: 32px;
        padding: 20px 10px;
    }
    
    .rates-table tbody td {
        padding: 28px 10px;
        font-size: 36px;
    }
    
    .rates-table tbody .currency-info {
        gap: 12px;
    }
    
    .currency-name-display {
        font-size: 30px;
    }
    
    .currency-code-display {
        font-size: 26px;
        padding: 8px 18px;
    }
    
    .buy-rate {
        font-size: 54px;
    }
    
    .sell-rate {
        font-size: 54px;
    }
}


