/* ===== SYRIAN CURRENCY CONVERTER  ===== */
/* Base Styles, Layout, Header, Calculator Card, Mode Selector, Input/Output Sections */

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #4f46e5, #06b6d4);
    --success-gradient: linear-gradient(135deg, #10b981, #059669);
    --warning-gradient: linear-gradient(135deg, #fbbf24, #f59e0b);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    padding: clamp(12px, 3vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 700px;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: clamp(20px, 5vw, 30px);
    color: white;
}

.flag-container {
    display: flex;
    justify-content: center;
    margin-bottom: clamp(16px, 4vw, 20px);
    animation: flagFadeIn 1s ease-out;
}

@keyframes flagFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-20px) scale(0.9);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

.syrian-flag {
    width: clamp(120px, 30vw, 160px);
    height: clamp(80px, 20vw, 107px);
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.4);
    position: relative;
    animation: flagWave 6s ease-in-out infinite;
    transform-origin: center;
}

.syrian-flag.small {
    width: clamp(60px, 15vw, 80px);
    height: clamp(40px, 10vw, 53px);
    animation: none;
    border-width: 2px;
}

@keyframes flagWave {
    0%, 100% { 
        transform: perspective(400px) rotateY(0deg);
        box-shadow: var(--shadow-xl);
    }
    25% { 
        transform: perspective(400px) rotateY(-5deg);
        box-shadow: -5px 10px 25px rgba(0, 0, 0, 0.5);
    }
    75% { 
        transform: perspective(400px) rotateY(5deg);
        box-shadow: 5px 10px 25px rgba(0, 0, 0, 0.5);
    }
}

.flag-stripe {
    width: 100%;
    height: 33.33%;
    position: relative;
}

.flag-green {
    background: linear-gradient(180deg, #007A3D 0%, #006633 100%);
}

.flag-white {
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2.5vw, 14px);
    padding: 0 10px;
}

.flag-black {
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
}

.flag-star {
    color: #CE1126;
    font-size: clamp(12px, 3.5vw, 18px);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    animation: starPulse 3s ease-in-out infinite;
}

.small .flag-star {
    font-size: clamp(6px, 1.8vw, 9px);
    animation: none;
}

@keyframes starPulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.15) rotate(5deg); 
        opacity: 0.9;
    }
}

.flag-star:nth-child(1) { animation-delay: 0s; }
.flag-star:nth-child(2) { animation-delay: 0.4s; }
.flag-star:nth-child(3) { animation-delay: 0.8s; }

.title {
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.subtitle {
    font-size: clamp(15px, 4vw, 20px);
    font-weight: 500;
    margin-bottom: 16px;
    opacity: 0.95;
    line-height: 1.4;
}

/* Info Box */
.info-box {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: clamp(12px, 3vw, 14px) clamp(18px, 4vw, 24px);
    border-radius: 12px;
    margin: 16px auto;
    max-width: 95%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.info-text {
    font-size: clamp(12px, 2.5vw, 15px);
    line-height: 1.6;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.info-text strong {
    font-size: clamp(13px, 2.8vw, 16px);
    display: block;
    margin-bottom: 2px;
    text-align: center;
}

.info-text-ar {
    font-size: clamp(13px, 2.8vw, 16px);
    display: block;
    font-weight: 500;
    direction: rtl;
    text-align: center;
}

.exchange-rate {
    font-size: clamp(11px, 2.3vw, 13px);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 12px;
    display: inline-block;
    line-height: 1.6;
    max-width: 95%;
}

/* ===== Calculator Card ===== */
.calculator-card {
    background: white;
    border-radius: 16px;
    padding: clamp(20px, 5vw, 40px);
    box-shadow: var(--shadow-xl);
}

/* ===== Mode Selector ===== */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 2vw, 12px);
    margin-bottom: clamp(24px, 6vw, 32px);
    background: #f8fafc;
    padding: 8px;
    border-radius: 12px;
}

.mode-button {
    padding: clamp(12px, 3vw, 14px) clamp(10px, 2.5vw, 12px);
    border: none;
    border-radius: 8px;
    font-size: clamp(11px, 2.2vw, 13px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: column;
    min-height: 44px;
}

.mode-icon {
    font-size: clamp(16px, 3.5vw, 20px);
}

.mode-text {
    font-size: clamp(9px, 2vw, 12px);
    white-space: nowrap;
}

.mode-button:hover:not(.active) {
    background: rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
}

.mode-button.active {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.mode-button:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
}

/* ===== Input Section ===== */
.input-section {
    margin-bottom: 24px;
}

.input-label,
.result-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    font-size: clamp(14px, 3vw, 16px);
    gap: 12px;
    flex-wrap: wrap;
}

.label-main {
    flex-shrink: 0;
}

.label-subtitle {
    font-size: clamp(12px, 2.7vw, 15px);
    font-weight: 500;
    color: #64748b;
    direction: rtl;
    flex-shrink: 0;
}

.input-wrapper {
    position: relative;
}

.currency-input {
    width: 100%;
    padding: clamp(14px, 3.5vw, 16px) clamp(60px, 15vw, 70px) clamp(14px, 3.5vw, 16px) clamp(20px, 5vw, 24px);
    font-size: clamp(18px, 4.5vw, 24px);
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.3s;
    outline: none;
    min-height: 44px;
}

.currency-input:focus {
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.currency-input::placeholder {
    color: #94a3b8;
}

.currency-symbol {
    position: absolute;
    right: clamp(18px, 4.5vw, 24px);
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(16px, 3.8vw, 20px);
    font-weight: 600;
    color: #64748b;
    pointer-events: none;
}

.error-message {
    color: #ef4444;
    font-size: clamp(11px, 2.5vw, 14px);
    margin-top: 8px;
    min-height: 20px;
}

/* ===== Conversion Arrow ===== */
.conversion-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    cursor: pointer;
    transition: all 0.3s;
    width: clamp(56px, 12vw, 70px);
    height: clamp(56px, 12vw, 70px);
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 3px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.conversion-arrow::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--secondary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.conversion-arrow:hover::before {
    opacity: 1;
}

.conversion-arrow:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
}

.arrow-icon {
    font-size: clamp(26px, 6vw, 36px);
    color: #4f46e5;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.swap-hint {
    font-size: clamp(8px, 1.8vw, 10px);
    font-weight: 600;
    color: #64748b;
    position: relative;
    z-index: 1;
    margin-top: -4px;
    transition: all 0.3s;
}

.conversion-arrow:hover .arrow-icon {
    color: white;
    transform: rotate(180deg) scale(1.1);
}

.conversion-arrow:hover .swap-hint {
    color: white;
}

.conversion-arrow:active {
    transform: scale(0.95);
}

/* ===== Result Section ===== */
.result-section {
    margin-bottom: 24px;
}

.result-display {
    background: var(--secondary-gradient);
    padding: clamp(20px, 5vw, 32px);
    border-radius: 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
    gap: 12px;
}

.result-display::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-display:hover {
    transform: scale(1.02);
}

.result-value {
    font-size: clamp(24px, 7vw, 40px);
    font-weight: 700;
    color: white;
    transition: transform 0.2s;
    position: relative;
    z-index: 1;
    word-break: break-all;
    line-height: 1.2;
}

.result-currency {
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* ===== Smart Suggestion ===== */
.smart-suggestion {
    margin: 24px 0;
    padding: 0;
    background: var(--warning-gradient);
    border: 3px solid #f59e0b;
    border-radius: 16px;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
    animation: suggestionSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes suggestionSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.smart-suggestion.visible {
    display: flex;
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: clamp(12px, 3vw, 16px);
    padding: clamp(16px, 4vw, 20px);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-bottom: 2px solid #d97706;
}

.suggestion-icon {
    font-size: clamp(28px, 7vw, 42px);
    flex-shrink: 0;
    animation: iconGlow 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(217, 119, 6, 0.5));
}

@keyframes iconGlow {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 2px 8px rgba(217, 119, 6, 0.5));
    }
    50% { 
        transform: scale(1.1) rotate(-10deg);
        filter: drop-shadow(0 4px 12px rgba(217, 119, 6, 0.8));
    }
}

.suggestion-titles {
    flex: 1;
}

.suggestion-title {
    font-size: clamp(15px, 3.5vw, 19px);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.suggestion-title-ar {
    font-size: clamp(13px, 3vw, 16px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    direction: rtl;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.suggestion-content {
    padding: clamp(16px, 4vw, 20px);
}

.suggestion-warning {
    font-size: clamp(13px, 3vw, 16px);
    color: #92400e;
    line-height: 1.7;
    margin-bottom: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    border-left: 4px solid #dc2626;
}

.suggestion-warning strong {
    color: #dc2626;
    font-weight: 800;
}

.suggestion-recommendation {
    font-size: clamp(13px, 3vw, 16px);
    color: #065f46;
    line-height: 1.7;
    margin-bottom: 20px;
    padding: 14px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    border-left: 4px solid #10b981;
}

.suggestion-recommendation strong {
    color: #047857;
    font-weight: 800;
}

.suggestion-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.suggestion-button {
    flex: 1;
    min-width: 200px;
    padding: clamp(12px, 3vw, 14px) clamp(16px, 4vw, 20px);
    background: var(--success-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: clamp(12px, 2.7vw, 15px);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 44px;
}

.suggestion-button:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.suggestion-button:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: clamp(16px, 4vw, 22px);
    animation: checkBounce 1.5s ease-in-out infinite;
}

@keyframes checkBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.suggestion-dismiss {
    padding: clamp(12px, 3vw, 14px) clamp(14px, 3.5vw, 18px);
    background: rgba(0, 0, 0, 0.1);
    color: #78350f;
    border: 2px solid rgba(120, 53, 15, 0.3);
    border-radius: 10px;
    font-size: clamp(14px, 3.5vw, 20px);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 44px;
    min-height: 44px;
}

.suggestion-dismiss:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: #78350f;
    transform: scale(1.1);
}

/* ===== Bills Breakdown ===== */
.bills-breakdown {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
}

.bills-breakdown.visible {
    max-height: 3000px;
    opacity: 1;
}

.breakdown-title {
    font-size: clamp(15px, 3.5vw, 18px);
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.4;
}

.bills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: clamp(12px, 3vw, 16px);
    margin-bottom: 24px;
}

.bill-item {
    padding: 0;
    border-radius: 16px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 3px solid rgba(255, 255, 255, 0.8);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: clamp(110px, 25vw, 140px);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    animation: billSlideIn 0.6s ease-out forwards;
}

@keyframes billSlideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bill-item:nth-child(1) { animation-delay: 0.1s; }
.bill-item:nth-child(2) { animation-delay: 0.2s; }
.bill-item:nth-child(3) { animation-delay: 0.3s; }
.bill-item:nth-child(4) { animation-delay: 0.4s; }
.bill-item:nth-child(5) { animation-delay: 0.5s; }
.bill-item:nth-child(6) { animation-delay: 0.6s; }

/* Bill background images with gradient fallback */
.bill-item[data-denom="10"] {
    background-image: url('images/10.png');
}

.bill-item[data-denom="10"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ff6b9d 0%, #fda4c3 50%, #ff85b3 100%);
    opacity: 0.6;
    z-index: 0;
}

.bill-item[data-denom="25"] {
    background-image: url('images/25.png');
}

.bill-item[data-denom="25"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #4dd0e1 0%, #80deea 50%, #26c6da 100%);
    opacity: 0.6;
    z-index: 0;
}

.bill-item[data-denom="50"] {
    background-image: url('images/50.png');
}

.bill-item[data-denom="50"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ffb74d 0%, #ffc947 50%, #ffa726 100%);
    opacity: 0.6;
    z-index: 0;
}

.bill-item[data-denom="100"] {
    background-image: url('images/100.png');
}

.bill-item[data-denom="100"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #f48fb1 0%, #f8bbd0 50%, #f06292 100%);
    opacity: 0.6;
    z-index: 0;
}

.bill-item[data-denom="200"] {
    background-image: url('images/200.png');
}

.bill-item[data-denom="200"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #81c784 0%, #a5d6a7 50%, #66bb6a 100%);
    opacity: 0.6;
    z-index: 0;
}

.bill-item[data-denom="500"] {
    background-image: url('images/500.png');
}

.bill-item[data-denom="500"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ffd54f 0%, #ffe082 50%, #ffca28 100%);
    opacity: 0.6;
    z-index: 0;
}

.bill-item:hover {
    transform: translateY(-8px) scale(1.08) rotate(2deg);
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.35);
}

.bill-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.15));
    z-index: 1;
    transition: opacity 0.3s;
}

.bill-item:hover::after {
    opacity: 0.5;
}

.bill-content {
    position: relative;
    z-index: 2;
    padding: clamp(14px, 4vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: clamp(110px, 25vw, 140px);
}

.bill-symbol {
    font-size: clamp(28px, 7vw, 40px);
    margin-bottom: 8px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
    animation: billFloat 3s ease-in-out infinite;
}

@keyframes billFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(-5deg); }
}

.bill-item:nth-child(1) .bill-symbol { animation-delay: 0s; }
.bill-item:nth-child(2) .bill-symbol { animation-delay: 0.3s; }
.bill-item:nth-child(3) .bill-symbol { animation-delay: 0.6s; }
.bill-item:nth-child(4) .bill-symbol { animation-delay: 0.9s; }
.bill-item:nth-child(5) .bill-symbol { animation-delay: 1.2s; }
.bill-item:nth-child(6) .bill-symbol { animation-delay: 1.5s; }

.bill-denomination {
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 700;
    color: #ffffff;
    display: block;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.3);
}

.bill-name {
    font-size: clamp(11px, 2.5vw, 13px);
    color: #ffffff;
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    direction: rtl;
}

.bill-count {
    font-size: clamp(13px, 3vw, 16px);
    color: #1e293b;
    font-weight: 700;
    display: inline-block;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 14px;
    border-radius: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 1);
    animation: countPulse 2s ease-in-out infinite;
}

@keyframes countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== Receipt Button ===== */
.receipt-button {
    width: 100%;
    padding: clamp(12px, 3vw, 16px);
    margin-top: 20px;
    background: var(--success-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: clamp(13px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    min-height: 44px;
}

.receipt-button:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.receipt-icon {
    font-size: clamp(16px, 4vw, 22px);
}

/* ===== Receipt Modal ===== */
.receipt-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.receipt-modal.visible {
    display: flex;
}

.receipt-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.receipt-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: receiptSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes receiptSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.receipt-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: #ef4444;
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.receipt-close:hover {
    background: #dc2626;
    transform: scale(1.1) rotate(90deg);
}

.receipt-paper {
    background: white;
    border-radius: 16px;
    padding: clamp(24px, 6vw, 32px) clamp(20px, 5vw, 24px);
    box-shadow: var(--shadow-xl);
    margin-bottom: 16px;
}

.receipt-header {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 2px dashed #e2e8f0;
    margin-bottom: 24px;
}

.receipt-flag {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.receipt-title {
    font-size: clamp(18px, 4.5vw, 24px);
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.receipt-title-ar {
    font-size: clamp(15px, 3.5vw, 18px);
    font-weight: 600;
    color: #64748b;
    direction: rtl;
    margin-bottom: 12px;
}

.receipt-date {
    font-size: clamp(11px, 2.5vw, 14px);
    color: #94a3b8;
}

.receipt-details {
    margin-bottom: 24px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.receipt-row.highlight {
    background: rgba(79, 70, 229, 0.05);
    padding: 16px 12px;
    border-radius: 10px;
    border: 2px solid #4f46e5;
    margin: 8px 0;
}

.receipt-label {
    font-size: clamp(12px, 2.8vw, 15px);
    color: #64748b;
    font-weight: 500;
}

.receipt-value {
    font-size: clamp(13px, 3vw, 16px);
    color: #1e293b;
    font-weight: 700;
    text-align: right;
}

.receipt-row.highlight .receipt-value {
    color: #4f46e5;
    font-size: clamp(16px, 4vw, 22px);
}

.receipt-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 2px dashed #e2e8f0;
    color: #94a3b8;
    font-size: clamp(10px, 2.3vw, 12px);
}

.receipt-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 12px;
}

.receipt-action-btn {
    padding: clamp(12px, 3vw, 14px);
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #1e293b;
    font-size: clamp(11px, 2.5vw, 14px);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    min-height: 44px;
}

.receipt-action-btn:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.receipt-action-btn span:first-child {
    font-size: clamp(18px, 4.5vw, 24px);
}

/* ===== Clear Button ===== */
.clear-button {
    width: 100%;
    padding: clamp(12px, 3vw, 16px);
    margin-top: 32px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #1e293b;
    font-size: clamp(13px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    min-height: 44px;
}

.clear-button:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.clear-button:active {
    transform: translateY(0);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    margin-top: 32px;
    color: white;
    font-size: clamp(11px, 2.5vw, 13px);
    opacity: 0.9;
    line-height: 1.8;
}

.footer-note {
    margin-top: 8px;
    font-size: clamp(10px, 2.2vw, 12px);
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    border-radius: 8px;
    display: inline-block;
    max-width: 95%;
}

.install-link {
    background: none;
    border: none;
    color: white;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
}

.install-link:hover {
    color: #fbbf24;
}

/* ===== Responsive Design ===== */
@media (max-width: 640px) {
    .mode-selector {
        gap: 6px;
    }

    .bills-grid {
        grid-template-columns: 1fr;
    }

    .input-label,
    .result-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .label-subtitle {
        align-self: flex-end;
    }

    .suggestion-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .suggestion-actions {
        flex-direction: column;
    }

    .suggestion-button {
        min-width: 100%;
    }

    .suggestion-dismiss {
        align-self: center;
        padding: 10px 24px;
    }

    .receipt-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    body {
        padding: 8px;
    }

    .calculator-card {
        padding: 16px;
    }

    .exchange-rate {
        font-size: 10px;
        padding: 8px 12px;
    }

    .info-box {
        padding: 10px 14px;
    }

    .mode-button {
        padding: 10px 8px;
    }
}

@media (min-width: 641px) {
    .bills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
    }

    .receipt-modal {
        position: static;
        display: block;
    }

    .receipt-overlay,
    .receipt-close,
    .receipt-actions {
        display: none;
    }

    .receipt-paper {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .calculator-card {
        border: 2px solid #000;
    }

    .mode-button {
        border: 1px solid currentColor;
    }

    .currency-input {
        border-width: 3px;
    }
}
/* ===== ADDITIONAL MOBILE & RESPONSIVE FIXES ===== */

/* Enhanced touch targets for mobile */
button, .mode-button, .conversion-arrow {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Improved input experience on mobile */
.currency-input {
    font-size: max(16px, clamp(18px, 4.5vw, 24px));
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.currency-input::-webkit-outer-spin-button,
.currency-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Better modal on small screens */
@media (max-width: 480px) {
    .receipt-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .receipt-paper {
        padding: 20px 16px;
    }
    
    .receipt-close {
        top: -8px;
        right: -8px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Landscape mobile optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .header {
        margin-bottom: 16px;
    }
    
    .flag-container {
        margin-bottom: 12px;
    }
    
    .syrian-flag {
        width: 100px;
        height: 67px;
    }
    
    .info-box {
        padding: 10px 16px;
        margin: 12px auto;
    }
    
    .exchange-rate {
        padding: 8px 16px;
        font-size: 11px;
    }
    
    .calculator-card {
        padding: 20px;
    }
    
    .mode-selector {
        margin-bottom: 20px;
    }
    
    .bills-breakdown {
        margin-top: 20px;
        padding-top: 20px;
    }
}

/* Very small devices (< 360px) */
@media (max-width: 359px) {
    body {
        padding: 6px;
    }
    
    .calculator-card {
        padding: 14px;
        border-radius: 12px;
    }
    
    .mode-button {
        padding: 10px 6px;
        gap: 4px;
    }
    
    .mode-icon {
        font-size: 14px;
    }
    
    .mode-text {
        font-size: 9px;
    }
    
    .currency-input {
        padding: 12px 50px 12px 16px;
        font-size: 18px;
    }
    
    .currency-symbol {
        right: 16px;
        font-size: 16px;
    }
    
    .conversion-arrow {
        width: 50px;
        height: 50px;
        margin: 16px auto;
    }
    
    .arrow-icon {
        font-size: 24px;
    }
    
    .swap-hint {
        font-size: 8px;
    }
    
    .result-display {
        padding: 16px;
    }
    
    .result-value {
        font-size: 20px;
    }
    
    .result-currency {
        font-size: 14px;
    }
    
    .suggestion-header {
        padding: 14px;
    }
    
    .suggestion-icon {
        font-size: 24px;
    }
    
    .suggestion-title {
        font-size: 14px;
    }
    
    .suggestion-title-ar {
        font-size: 12px;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    .currency-input {
        font-size: 16px; /* Prevents zoom on focus */
    }
    
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    .calculator-card {
        -webkit-transform: translate3d(0, 0, 0);
    }
}

/* Android specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    .currency-input {
        font-size: max(16px, 1.1em);
    }
}

/* Tablet optimizations (iPad, etc) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 600px;
    }
    
    .bills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .calculator-card {
        padding: 36px;
    }
    
    .mode-selector {
        gap: 12px;
    }
}

/* Large screens */
@media (min-width: 1025px) {
    .container {
        max-width: 750px;
    }
    
    .bills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .calculator-card {
        padding: 44px;
    }
}

/* Focus improvements for keyboard navigation */
*:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 4px;
}

.mode-button:focus-visible,
.conversion-arrow:focus-visible,
button:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
}

/* Loading state improvements */
.currency-input:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Smooth scroll for modal */
.receipt-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Better print styles */
@media print {
    .header,
    .footer,
    .mode-selector,
    .input-section,
    .conversion-arrow,
    .clear-button,
    .receipt-button,
    .smart-suggestion {
        display: none !important;
    }
    
    .calculator-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .result-display {
        border: 2px solid #000;
        color: #000 !important;
    }
    
    .bills-breakdown {
        display: block !important;
        opacity: 1 !important;
        max-height: none !important;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for now, but structure is ready for dark mode */
}

/* Prevent text selection on UI elements */
.mode-button,
.conversion-arrow,
.receipt-close,
.suggestion-button,
.suggestion-dismiss,
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection for inputs and results */
.currency-input,
.result-value,
.receipt-paper {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Performance optimization for animations on low-end devices */
@media (prefers-reduced-motion: no-preference) {
    .bill-item,
    .result-display,
    .mode-button {
        will-change: transform;
    }
}

/* Ensure proper rendering on Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .syrian-flag,
    .bill-item {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Better accessibility for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Fix for sticky hover states on touch devices */
@media (hover: none) and (pointer: coarse) {
    .mode-button:hover:not(.active),
    .conversion-arrow:hover,
    .bill-item:hover,
    button:hover {
        transform: none;
    }
    
    .mode-button:active,
    .conversion-arrow:active,
    button:active {
        transform: scale(0.95);
    }
}

/* Improved button active states for mobile */
@media (max-width: 640px) {
    .mode-button:active {
        transform: scale(0.97);
    }
    
    .suggestion-button:active {
        transform: translateY(0) scale(0.98);
    }
    
    .clear-button:active,
    .receipt-button:active {
        transform: translateY(0) scale(0.98);
    }
}
/* ===== ADDITIONAL STYLES - ADD TO EXISTING style.css ===== */

/* Online/Offline Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: 600;
    margin-top: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    animation: statusPulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

@keyframes statusPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.status-indicator.offline .status-dot {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    animation: statusPulseRed 2s ease-in-out infinite;
}

@keyframes statusPulseRed {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.status-text {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    font-size: clamp(14px, 3.5vw, 18px);
    font-weight: 600;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced button feedback for touch devices */
.touch-device .mode-button:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

.touch-device .conversion-arrow:active {
    transform: scale(0.9) rotate(180deg);
    transition: transform 0.2s;
}

.touch-device .suggestion-button:active {
    transform: translateY(2px) scale(0.98);
    transition: transform 0.1s;
}

.touch-device .clear-button:active,
.touch-device .receipt-button:active {
    transform: translateY(2px) scale(0.98);
    transition: transform 0.1s;
}

/* iOS Standalone Mode Adjustments */
.ios-standalone body {
    padding-top: var(--safe-area-top, 0);
    padding-bottom: var(--safe-area-bottom, 0);
}

.ios-standalone .header {
    padding-top: max(20px, var(--safe-area-top, 0));
}

/* Improved receipt modal scrolling for iOS */
.receipt-content {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Better input handling on iOS */
.currency-input {
    -webkit-appearance: none;
    appearance: none;
}

.currency-input:focus {
    font-size: 16px; /* Prevent iOS zoom */
}

/* Smooth transitions for status changes */
.calculator-card {
    transition: opacity 0.3s ease;
}

.calculator-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Enhanced suggestion box animations */
.smart-suggestion {
    transform-origin: top center;
}

.smart-suggestion.visible {
    animation: suggestionSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes suggestionSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 1000px;
    }
}

/* Improved error message styling */
.error-message {
    min-height: 24px;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.error-message:not(:empty) {
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Better focus states for accessibility */
*:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 4px;
}

.mode-button:focus-visible {
    outline-offset: 4px;
}

/* Improved print styles */
@media print {
    .loading-overlay,
    .status-indicator {
        display: none !important;
    }
}

/* Enhanced responsive bill grid */
@media (max-width: 480px) {
    .bills-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .bill-item {
        min-height: 100px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .bills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Smooth state transitions */
.result-value,
.bill-item,
.smart-suggestion {
    will-change: transform;
}

/* Better contrast for accessibility */
@media (prefers-contrast: high) {
    .status-indicator {
        border-width: 3px;
        border-color: white;
    }
    
    .status-dot {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .status-dot,
    .loading-spinner,
    .bill-symbol,
    .flag-star {
        animation: none !important;
    }
    
    .smart-suggestion.visible {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
}

/* Dark mode preparation (optional) */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for now, but structure is ready */
}

/* Ultra-wide screen support */
@media (min-width: 1400px) {
    .container {
        max-width: 800px;
    }
    
    .bills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

/* Landscape mobile optimization improvements */
@media (max-height: 600px) and (orientation: landscape) {
    .status-indicator {
        padding: 4px 10px;
        font-size: 10px;
        margin-top: 8px;
    }
    
    .status-dot {
        width: 8px;
        height: 8px;
    }
}

/* Performance optimization hints */
.bill-item,
.result-display,
.mode-button,
.conversion-arrow {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Ensure proper layering */
.receipt-modal {
    isolation: isolate;
}

.receipt-overlay {
    z-index: 1;
}

.receipt-content {
    z-index: 2;
    position: relative;
}

/* Better touch feedback */
@media (hover: none) and (pointer: coarse) {
    .mode-button:active {
        background: rgba(79, 70, 229, 0.2);
    }
    
    .bill-item:active {
        transform: scale(0.98);
    }
}
/* ===== ENHANCED STYLES - ADD TO END OF EXISTING style.css ===== */

/* Better number truncation for large amounts */
.result-value {
    word-break: keep-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Improved input validation feedback */
.currency-input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.currency-input.success {
    border-color: #10b981;
}

/* Enhanced loading states */
.calculator-card.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.calculator-card.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Better suggestion visibility on small screens */
@media (max-width: 480px) {
    .suggestion-warning,
    .suggestion-recommendation {
        font-size: 12px;
        padding: 12px;
    }
    
    .suggestion-title {
        font-size: 14px;
    }
    
    .suggestion-title-ar {
        font-size: 12px;
    }
}

/* Improved bill animations */
.bill-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bill-item:active {
    transform: scale(0.97);
}

/* Better focus states for accessibility */
input:focus-visible,
button:focus-visible,
.mode-button:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 3px;
    border-radius: 8px;
}

/* Enhanced status indicator animation */
.status-indicator {
    transition: all 0.3s ease;
}

.status-indicator.offline {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.status-indicator.online {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

/* Better error message animation */
.error-message {
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.error-message:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

/* Improved modal backdrop blur */
.receipt-overlay {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Better button feedback */
button:active:not(:disabled),
.mode-button:active {
    transform: scale(0.97);
}

/* Enhanced scroll behavior */
.receipt-content {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Better text selection */
.result-value,
.bill-denomination,
.receipt-value {
    user-select: text;
    -webkit-user-select: text;
}

/* Improved contrast for readability */
@media (prefers-contrast: high) {
    .currency-input,
    .result-display,
    .bill-item {
        border-width: 3px;
    }
    
    .mode-button {
        border: 2px solid currentColor;
    }
}

/* Better animation performance */
@media (prefers-reduced-motion: no-preference) {
    .bill-item,
    .result-display,
    .mode-button,
    .conversion-arrow {
        will-change: transform;
        transform: translateZ(0);
    }
}

/* Enhanced print styles */
@media print {
    * {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .bills-breakdown {
        page-break-inside: avoid;
    }
    
    .bill-item {
        page-break-inside: avoid;
    }
}

/* Better handling of very long numbers */
.result-value,
.receipt-value {
    font-variant-numeric: tabular-nums;
}

/* Improved touch targets for mobile */
@media (max-width: 640px) {
    button,
    .mode-button,
    .conversion-arrow {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Better visual hierarchy */
.smart-suggestion.visible {
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.5),
                0 0 0 1px rgba(251, 191, 36, 0.2);
}

/* Enhanced gradient backgrounds */
.result-display::before {
    opacity: 0.15;
}

.result-display:hover::before {
    opacity: 0.25;
}

/* Better spacing for RTL text */
.label-subtitle,
.info-text-ar,
.suggestion-title-ar,
.receipt-title-ar {
    letter-spacing: 0.02em;
}

/* Improved mode button states */
.mode-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mode-button.active::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid rgba(79, 70, 229, 0.3);
    border-radius: 10px;
    pointer-events: none;
}

/* Better visual feedback for swap */
.conversion-arrow:active {
    transform: rotate(180deg) scale(0.85);
}

/* Enhanced suggestion button states */
.suggestion-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Better overflow handling */
.bill-name,
.bill-denomination {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Improved backdrop for modals */
.receipt-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.6);
}

/* Better animation timing */
.smart-suggestion,
.bills-breakdown {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                transform 0.3s ease;
}

/* Enhanced focus ring */
*:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
    transition: outline-offset 0.2s ease;
}

*:focus-visible:active {
    outline-offset: 0px;
}

/* Better bill breakdown layout */
.bills-grid {
    animation: gridFadeIn 0.5s ease-out;
}

@keyframes gridFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Improved receipt paper effect */
.receipt-paper {
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Better text rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced button ripple effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.suggestion-button::after,
.clear-button::after,
.receipt-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.suggestion-button:active::after,
.clear-button:active::after,
.receipt-button:active::after {
    width: 100px;
    height: 100px;
    animation: ripple 0.6s ease-out;
}

/* Better scroll indicators */
.receipt-content::-webkit-scrollbar {
    width: 8px;
}

.receipt-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.receipt-content::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 4px;
}

.receipt-content::-webkit-scrollbar-thumb:hover {
    background: #4338ca;
}

/* Enhanced landscape mode support */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        margin-bottom: 12px;
    }
    
    .calculator-card {
        padding: 16px;
    }
    
    .mode-selector {
        gap: 6px;
        margin-bottom: 16px;
    }
    
    .conversion-arrow {
        margin: 12px auto;
    }
}

/* Better handling of notch/safe areas */
@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}

/* Improved dark mode readiness */
@media (prefers-color-scheme: dark) {
    /* Keep light theme but improve contrast */
    .calculator-card {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    }
}

/* Better high DPI display support */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .syrian-flag,
    .bill-item {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Enhanced accessibility for motion sensitivity */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .status-dot,
    .bill-symbol,
    .flag-star {
        animation: none !important;
    }
}

/* Better handling of landscape tablets */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .container {
        max-width: 700px;
    }
    
    .bills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Improved very small screen support */
@media (max-width: 320px) {
    body {
        padding: 4px;
    }
    
    .calculator-card {
        padding: 12px;
    }
    
    .mode-selector {
        gap: 4px;
        padding: 6px;
    }
    
    .mode-button {
        padding: 8px 6px;
        font-size: 10px;
    }
}