/* ==================== Reset & Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-dark: #5568d3;
    --primary-light: #8b9fff;
    
    /* Secondary Colors */
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-color: #00c853;
    --warning-color: #ff9800;
    --error-color: #f44336;
    
    /* Neutral Colors */
    --bg-primary: #f8f9ff;
    --bg-secondary: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --border-color: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 30px 60px rgba(0, 0, 0, 0.2);
    
    /* Effects */
    --blur-glass: blur(20px);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, -apple-system, BlinkMacSystemFont;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* جلوگیری از overflow در تمام المان‌ها */
* {
    max-width: 100%;
}

/* اجازه به برخی المان‌ها برای داشتن max-width بیشتر */
.card,
.section,
.stats-container,
.stats-grid,
.codes-stats-display,
.history-list,
table {
    max-width: none;
}

/* container اصلی */
.main-container,
.card,
.section {
    box-sizing: border-box;
}

/* ==================== Particles Background ==================== */
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    overflow: hidden;
}

.particles-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-20px, 20px); }
}

/* ==================== Main Container ==================== */
.main-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ==================== Brand Header ==================== */
.brand-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
}

.premium-badge {
    position: fixed;
    top: -10px;
    left: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.5);
    transition: var(--transition-base);
    z-index: 1000;
    overflow: visible;
}

.premium-badge:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 15px 40px rgba(240, 147, 251, 0.7);
}

.premium-icon {
    width: 18px;
    height: 18px;
    animation: rotateStar 3s ease-in-out infinite;
}

@keyframes rotateStar {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

.premium-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.4);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    color: white;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: rotate3d 3s ease-in-out infinite;
}

@keyframes rotate3d {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.brand-name {
    font-size: 36px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.brand-tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==================== Real-time Status Indicator ==================== */
.realtime-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.5s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.2);
        box-shadow: 0 0 15px rgba(76, 175, 80, 1);
    }
}

.status-text {
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.realtime-status.offline .status-dot {
    background: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.8);
    animation: none;
}

.realtime-status.offline .status-text {
    opacity: 0.8;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Card ==================== */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--blur-glass);
    border-radius: 24px;
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Sections ==================== */
.section {
    padding: 40px;
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section-header {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
}

.back-btn {
    position: absolute;
    right: 0;
    top: 0;
    background: rgba(102, 126, 234, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    color: var(--primary-dark);
}

.back-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.header-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header-icon svg {
    width: 35px;
    height: 35px;
    color: white;
}

.section-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ==================== Form Styles ==================== */
.form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 28px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.label-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-dark);
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition-base);
    background: white;
    color: var(--text-primary);
    direction: ltr;
    text-align: left;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input.error {
    border-color: var(--error-color);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-input.success {
    border-color: var(--success-color);
}

.input-indicator {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.form-input.success ~ .input-indicator {
    display: flex;
    background: var(--success-color);
    animation: scaleIn 0.3s ease;
}

.form-input.success ~ .input-indicator::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 8px;
    display: none;
    align-items: center;
    gap: 6px;
}

.error-message.show {
    display: flex;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message::before {
    content: '⚠';
    font-size: 14px;
}

.error-message.duplicate {
    color: var(--warning-color);
    background: rgba(255, 152, 0, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.error-message.duplicate::before {
    content: '🔄';
}

.input-helper {
    color: var(--text-light);
    font-size: 12px;
    margin-top: 6px;
}

/* ==================== Buttons ==================== */
.btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(79, 172, 254, 0.4);
}

.btn-outline {
    background: white;
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-loader {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn.loading .btn-content {
    display: none;
}

.btn.loading .btn-loader {
    display: flex;
}

.loader-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Statistics ==================== */
.stats-container {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 28px;
    border-radius: 20px;
    margin-top: 30px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.stats-icon {
    width: 28px;
    height: 28px;
    color: var(--primary-dark);
}

.stats-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Background Icon for Desktop */
@media (min-width: 769px) {
    .stat-card::before {
        content: '';
        position: absolute;
        left: -20px;
        top: 50%;
        transform: translateY(-50%) rotate(-15deg);
        width: 80px;
        height: 80px;
        opacity: 0.15;
        border-radius: 16px;
        pointer-events: none;
        z-index: 0;
    }

    .stat-primary::before {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    }

    .stat-success::before {
        background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
        box-shadow: 0 8px 32px rgba(79, 172, 254, 0.2);
    }

    .stat-info::before {
        background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
        box-shadow: 0 8px 32px rgba(67, 233, 123, 0.2);
    }

    .stat-warning::before {
        background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
        box-shadow: 0 8px 32px rgba(250, 112, 154, 0.2);
    }

    .stat-purple::before {
        background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
        box-shadow: 0 8px 32px rgba(168, 237, 234, 0.2);
    }

    .stat-teal::before {
        background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
        box-shadow: 0 8px 32px rgba(48, 207, 208, 0.2);
    }

    .stat-card .stat-icon {
        display: none;
    }

    .stat-card .stat-content {
        position: relative;
        z-index: 1;
    }

    .stat-value {
        font-size: 28px;
    }
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-info .stat-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-warning .stat-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-purple .stat-icon {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.stat-teal .stat-icon {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.stat-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card-wide {
    grid-column: span 3;
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

.stat-card-wide:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-gradient-1 {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.stat-gradient-2 {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.stat-wide-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-wide-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stat-wide-content .stat-label {
    font-size: 13px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-wide-value {
    display: flex;
    align-items: baseline;
    gap: 12px;
    overflow: hidden;
    flex-wrap: wrap;
}

.stat-code {
    font-size: 32px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    word-break: break-all;
}

.stat-time {
    font-size: 14px;
    color: var(--text-light);
    direction: ltr;
}

.stat-percentage {
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 16px;
}

.progress-fill {
    height: 100%;
    background: var(--success-gradient);
    border-radius: 10px;
    transition: width 1s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== Success Animation ==================== */
.success-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.success-checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 10px 40px rgba(79, 172, 254, 0.4);
    animation: scaleIn 0.5s ease;
}

.checkmark {
    width: 60px;
    height: 60px;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke: white;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: white;
    stroke-width: 3;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* ==================== Result Section ==================== */
.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.result-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.code-container {
    background: var(--primary-gradient);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.code-container::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: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.code-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
    direction: ltr;
}

.code-digit {
    width: 60px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: popIn 0.5s ease backwards;
}

.code-digit:nth-child(1) { animation-delay: 0.1s; }
.code-digit:nth-child(2) { animation-delay: 0.2s; }
.code-digit:nth-child(3) { animation-delay: 0.3s; }

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0) rotateY(180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.copy-btn svg {
    width: 18px;
    height: 18px;
}

.copy-btn:hover {
    background: white;
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.result-details {
    background: rgba(102, 126, 234, 0.05);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    direction: ltr;
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ==================== History Section ==================== */
.backup-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 20px;
    border-radius: 14px;
    border: 2px dashed rgba(102, 126, 234, 0.2);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: var(--transition-base);
}

.backup-info.backup-active {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.1) 0%, rgba(56, 249, 215, 0.1) 100%);
    border-color: rgba(67, 233, 123, 0.3);
    border-style: solid;
}

.backup-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.backup-status svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.backup-info.backup-active .backup-status svg {
    color: var(--success-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes fadeOut {
    from { 
        opacity: 1; 
        transform: scale(1); 
    }
    to { 
        opacity: 0; 
        transform: scale(0.5); 
    }
}

.backup-status span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-toggle-backup {
    padding: 10px 20px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn-toggle-backup:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.backup-info.backup-active .btn-toggle-backup {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.backup-info.backup-active .btn-toggle-backup:hover {
    background: var(--error-color);
    color: white;
}

.history-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.btn-small {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-small svg {
    width: 16px;
    height: 16px;
}

.btn-reload {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-reload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-export {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 172, 254, 0.4);
}

.btn-import {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-import:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-clear {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.btn-clear:hover {
    background: var(--error-color);
    color: white;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 10px;
}

.history-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    transition: var(--transition-base);
    animation: slideInRight 0.4s ease backwards;
}

.history-item:hover {
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateX(-5px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-code {
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    direction: ltr;
}

.history-date {
    color: var(--text-light);
    font-size: 12px;
    direction: ltr;
}

.history-item-details {
    display: grid;
    gap: 8px;
}

.history-detail {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.history-detail-label {
    color: var(--text-secondary);
}

.history-detail-value {
    color: var(--text-primary);
    font-weight: 600;
    direction: ltr;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== Footer ==================== */
.footer {
    margin-top: 30px;
    text-align: center;
    animation: fadeIn 1s ease 0.5s both;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==================== Security Modal ==================== */
.security-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.security-modal.active {
    opacity: 1;
    visibility: visible;
}

.security-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(20px);
}

.security-content {
    position: relative;
    z-index: 1;
    background: white;
    padding: 50px;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.security-modal.active .security-content {
    transform: scale(1);
}

.security-header {
    text-align: center;
    margin-bottom: 35px;
}

.security-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    animation: bounce 2s ease-in-out infinite;
}

.security-icon svg {
    width: 50px;
    height: 50px;
    color: white;
}

.security-title {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.security-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.security-form {
    margin-bottom: 25px;
}

.security-input-group {
    margin-bottom: 25px;
}

.security-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.security-label svg {
    width: 18px;
    height: 18px;
    color: var(--primary-dark);
}

.security-input-wrapper {
    position: relative;
}

.security-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.security-input:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.security-input.error {
    border-color: var(--error-color);
}

.security-input.success {
    border-color: var(--success-color);
}

.security-toggle-password {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-light);
    transition: var(--transition-base);
}

.security-toggle-password:hover {
    color: var(--primary-dark);
}

.security-toggle-password svg {
    width: 20px;
    height: 20px;
}

.security-error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 8px;
    display: none;
    align-items: center;
    gap: 6px;
}

.security-error.show {
    display: flex;
}

.security-helper {
    color: var(--text-light);
    font-size: 12px;
    margin-top: 8px;
}

.security-submit {
    width: 100%;
    padding: 18px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.security-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.security-submit svg {
    width: 20px;
    height: 20px;
}

.security-footer {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.security-footer svg {
    width: 20px;
    height: 20px;
    color: var(--warning-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.security-footer p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

/* Security Modal Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* ==================== Confirm Delete Modal ==================== */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-modal.active {
    opacity: 1;
    visibility: visible;
}

.confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.confirm-content {
    position: relative;
    z-index: 1;
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.confirm-modal.active .confirm-content {
    transform: scale(1);
}

.confirm-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.confirm-icon svg {
    width: 45px;
    height: 45px;
    color: white;
}

.confirm-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.confirm-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.confirm-note {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.08) 0%, rgba(0, 242, 254, 0.08) 100%);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 25px;
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.confirm-note svg {
    width: 20px;
    height: 20px;
    color: var(--primary-dark);
    flex-shrink: 0;
    margin-top: 2px;
}

.confirm-note p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.confirm-note strong {
    color: var(--primary-dark);
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.confirm-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.confirm-btn svg {
    width: 18px;
    height: 18px;
}

.confirm-cancel {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
}

.confirm-cancel:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

.confirm-delete {
    background: var(--error-color);
    color: white;
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.3);
}

.confirm-delete:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.5);
}

/* Security Modal Responsive */
@media (max-width: 768px) {
    .security-content {
        padding: 40px 30px;
        max-width: 95%;
    }

    .security-title {
        font-size: 24px;
    }

    .security-subtitle {
        font-size: 15px;
    }

    .security-icon {
        width: 75px;
        height: 75px;
        margin-bottom: 20px;
    }

    .security-icon svg {
        width: 42px;
        height: 42px;
    }

    .security-input {
        padding: 15px 50px 15px 18px;
        font-size: 15px;
    }

    .security-submit {
        padding: 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .security-content {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .security-header {
        margin-bottom: 25px;
    }

    .security-title {
        font-size: 20px;
    }

    .security-subtitle {
        font-size: 14px;
    }

    .security-icon {
        width: 65px;
        height: 65px;
        margin-bottom: 18px;
    }

    .security-icon svg {
        width: 36px;
        height: 36px;
    }

    .security-input {
        padding: 14px 45px 14px 16px;
        font-size: 14px;
    }

    .security-label {
        font-size: 13px;
    }

    .security-submit {
        padding: 15px;
        font-size: 14px;
    }

    .security-footer {
        padding: 14px;
    }

    .security-footer p {
        font-size: 12px;
    }

    .security-helper {
        font-size: 11px;
    }

    .confirm-content {
        padding: 30px 20px;
    }

    .confirm-icon {
        width: 65px;
        height: 65px;
    }

    .confirm-icon svg {
        width: 36px;
        height: 36px;
    }

    .confirm-title {
        font-size: 20px;
    }

    .confirm-message {
        font-size: 14px;
    }

    .confirm-note {
        padding: 12px;
    }

    .confirm-note p {
        font-size: 12px;
    }

    .confirm-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .confirm-btn {
        padding: 13px 18px;
        font-size: 14px;
    }
}

/* ==================== Toast Notification ==================== */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateX(400px);
    transition: var(--transition-base);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    color: var(--success-color);
}

.toast-message {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .stats-container {
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .stat-card-wide {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .stats-container {
        padding: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 18px;
        gap: 12px;
    }

    .stat-card-wide {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .main-container {
        padding: 20px 15px;
    }

    .brand-name {
        font-size: 28px;
    }

    .brand-tagline {
        font-size: 14px;
    }

    .card {
        border-radius: 20px;
    }

    .section {
        padding: 30px 24px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .header-icon {
        width: 60px;
        height: 60px;
    }

    .header-icon svg {
        width: 30px;
        height: 30px;
    }

    .code-digit {
        width: 50px;
        height: 60px;
        font-size: 30px;
        gap: 10px;
    }

    .result-actions {
        grid-template-columns: 1fr;
    }

    .stats-container {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card-wide {
        grid-column: span 1;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-code {
        font-size: 24px;
    }

    .backup-info {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 12px;
    }

    .backup-status {
        justify-content: center;
    }

    .backup-status span {
        font-size: 13px;
    }

    .btn-toggle-backup {
        width: 100%;
        padding: 12px 16px;
        font-size: 12px;
    }

    .history-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-small {
        font-size: 12px;
        padding: 11px 14px;
    }

    .btn-small svg {
        width: 14px;
        height: 14px;
    }

    .toast {
        top: 15px;
        right: 15px;
        left: 15px;
        padding: 14px 18px;
    }

    .toast-message {
        font-size: 13px;
    }

    .premium-badge {
        top: 0px;
        left: 10px;
        padding: 10px 16px;
        font-size: 12px;
        gap: 6px;
    }

    .premium-icon {
        width: 14px;
        height: 14px;
    }

    .toast {
        right: 15px;
        top: 20px;
        left: 15px;
        transform: translateY(-200px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card-wide {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .code-digit {
        width: 45px;
        height: 55px;
        font-size: 26px;
        gap: 8px;
    }

    .history-actions {
        flex-direction: column;
    }
}

/* ==================== Premium Modal ==================== */
.premium-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.premium-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.premium-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.premium-modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.5s ease;
    padding: 50px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-modal-content::-webkit-scrollbar {
    width: 8px;
}

.premium-modal-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

.premium-modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 10px;
}

.premium-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(244, 67, 54, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    color: var(--error-color);
    z-index: 10;
}

.premium-close:hover {
    background: var(--error-color);
    color: white;
    transform: rotate(90deg);
}

.premium-close svg {
    width: 20px;
    height: 20px;
}

.premium-header {
    text-align: center;
    margin-bottom: 50px;
}

.premium-header-badge {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s ease-in-out infinite;
}

.premium-star {
    width: 40px;
    height: 40px;
    color: white;
}

.premium-title {
    font-size: 36px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.premium-subtitle {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Comparison Cards */
.premium-comparison {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 60px;
}

.comparison-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    border: 2px solid var(--border-color);
    transition: var(--transition-base);
    position: relative;
}

.comparison-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.free-card {
    border-color: var(--border-color);
}

.bot-card {
    border-color: #0088cc;
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.03) 0%, rgba(43, 156, 212, 0.03) 100%);
}

.pro-card {
    border-color: var(--primary-dark);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
}

.comparison-badge {
    position: absolute;
    top: -15px;
    right: 30px;
    background: var(--secondary-gradient);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.bot-badge {
    background: linear-gradient(135deg, #0088cc 0%, #2b9cd4 100%);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.4);
}

.comparison-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.comparison-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.comparison-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.price-currency {
    font-size: 14px;
    color: var(--text-secondary);
}

.price-amount {
    font-size: 42px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-period {
    font-size: 14px;
    color: var(--text-secondary);
}

.comparison-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    font-size: 15px;
    color: var(--text-primary);
}

.feature-item.highlight {
    background: rgba(102, 126, 234, 0.05);
    padding: 12px 15px;
    border-radius: 10px;
    margin: 5px 0;
}

.feature-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.feature-item.available .feature-icon {
    color: var(--success-color);
}

.feature-item.unavailable {
    opacity: 0.4;
}

.feature-item.unavailable .feature-icon {
    color: var(--error-color);
}

.btn-purchase {
    width: 100%;
    padding: 18px 30px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-purchase:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.btn-purchase .btn-icon {
    width: 24px;
    height: 24px;
}

.btn-purchase-bot {
    background: linear-gradient(135deg, #0088cc 0%, #2b9cd4 100%);
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.4);
}

.btn-purchase-bot:hover {
    box-shadow: 0 15px 40px rgba(0, 136, 204, 0.6);
}

/* Features Showcase */
.premium-features-showcase {
    margin-bottom: 50px;
}

.showcase-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.showcase-item {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.showcase-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-dark);
}

.showcase-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.showcase-icon svg {
    width: 35px;
    height: 35px;
    color: white;
}

.showcase-item h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.showcase-item p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* Contact Info */
.premium-contact {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
}

.premium-contact h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: white;
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: var(--primary-gradient);
    color: white;
}

.contact-item svg {
    width: 20px;
    height: 20px;
}

.contact-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.contact-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    color: white;
    transform: translateY(-3px) scale(1.02);
}

/* Guarantee */
.premium-guarantee {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.1) 0%, rgba(56, 249, 215, 0.1) 100%);
    border-radius: 16px;
    border: 2px solid rgba(67, 233, 123, 0.2);
}

.premium-guarantee svg {
    width: 50px;
    height: 50px;
    color: var(--success-color);
    flex-shrink: 0;
}

.premium-guarantee strong {
    display: block;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.premium-guarantee p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Responsive Premium Modal */
@media (max-width: 1200px) {
    .premium-comparison {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .comparison-card {
        padding: 35px;
    }

    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .premium-modal-content {
        padding: 40px 30px;
    }
}

@media (max-width: 1024px) {
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .premium-modal-content {
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .premium-badge {
        top: 10px;
        left: 10px;
        padding: 10px 18px;
        font-size: 12px;
    }

    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .showcase-item {
        padding: 25px;
    }

    .showcase-item h4 {
        font-size: 16px;
    }

    .showcase-item p {
        font-size: 13px;
    }

    .premium-title {
        font-size: 26px;
    }

    .premium-subtitle {
        font-size: 16px;
    }

    .premium-modal-content {
        padding: 30px 20px;
        border-radius: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .comparison-card {
        padding: 30px 25px;
    }

    .comparison-header h3 {
        font-size: 20px;
    }

    .price-amount {
        font-size: 36px;
    }

    .feature-item {
        font-size: 14px;
    }

    .contact-info {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .contact-item {
        justify-content: center;
        padding: 14px 24px;
    }

    .premium-guarantee {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }

    .premium-guarantee strong {
        font-size: 16px;
    }

    .premium-guarantee p {
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .comparison-card {
        padding: 25px 20px;
    }

    .comparison-header h3 {
        font-size: 18px;
    }

    .price-amount {
        font-size: 32px;
    }

    .price-currency {
        font-size: 12px;
    }

    .price-period {
        font-size: 12px;
    }

    .showcase-title {
        font-size: 20px;
    }

    .showcase-item {
        padding: 20px;
    }

    .showcase-icon {
        width: 60px;
        height: 60px;
    }

    .showcase-icon svg {
        width: 30px;
        height: 30px;
    }

    .premium-contact h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .premium-features-showcase {
        margin-bottom: 35px;
    }

    .comparison-badge {
        font-size: 11px;
        padding: 6px 16px;
        top: -12px;
        right: 20px;
    }

    .feature-item {
        font-size: 13px;
        padding: 10px 0;
    }

    .feature-item.highlight {
        padding: 10px 12px;
    }

    .btn-purchase {
        font-size: 15px;
        padding: 15px 24px;
    }
}

/* ==================== Delete Single Button ==================== */
.history-item {
    position: relative;
}

.btn-delete-single {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.3);
    z-index: 10;
}

.btn-delete-single svg {
    width: 20px;
    height: 20px;
    stroke: white;
    transition: transform 0.3s ease;
}

.btn-delete-single:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(238, 90, 111, 0.5);
    background: linear-gradient(135deg, #ff5252 0%, #dc4254 100%);
}

.btn-delete-single:hover svg {
    transform: scale(1.1) rotate(5deg);
}

.btn-delete-single:active {
    transform: translateY(-50%) scale(0.95);
}

/* افزایش padding سمت چپ برای آیتم‌های تاریخچه */
.history-item {
    padding-left: 70px;
    max-width: 100%;
    box-sizing: border-box;
}

.history-item-header,
.history-item-details {
    max-width: 100%;
    overflow: hidden;
}

.history-code,
.history-date,
.history-detail-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .btn-delete-single {
        width: 36px;
        height: 36px;
        left: 10px;
    }
    
    .btn-delete-single svg {
        width: 18px;
        height: 18px;
    }
    
    .history-item {
        padding-left: 55px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .btn-delete-single {
        width: 32px;
        height: 32px;
        left: 8px;
    }
    
    .btn-delete-single svg {
        width: 16px;
        height: 16px;
    }
    
    .history-item {
        padding-left: 50px;
        padding-right: 12px;
    }
    
    .history-code {
        font-size: 18px;
    }
    
    .history-date {
        font-size: 11px;
    }
    
    .history-detail-label,
    .history-detail-value {
        font-size: 12px;
    }
}

/* ==================== Codes Stats Display ==================== */
.codes-stats-display {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 20px 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.code-stat-item {
    background: white;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    min-width: 0;
    overflow: hidden;
}

.code-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.code-stat-item.available {
    border-color: #48bb78;
}

.code-stat-item.available .stat-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.code-stat-item.available .stat-value {
    color: #48bb78;
}

.code-stat-item.used {
    border-color: #ed8936;
}

.code-stat-item.used .stat-icon {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.code-stat-item.used .stat-value {
    color: #ed8936;
}

.code-stat-item.total {
    border-color: #667eea;
}

.code-stat-item.total .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.code-stat-item.total .stat-value {
    color: #667eea;
}

.code-stat-item .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.code-stat-item .stat-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.code-stat-item .stat-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.code-stat-item .stat-value {
    font-size: 26px;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-stat-item .stat-label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive - همیشه یک ستون */
@media (max-width: 768px) {
    .code-stat-item {
        padding: 16px;
        gap: 12px;
    }
    
    .code-stat-item .stat-icon {
        width: 45px;
        height: 45px;
    }
    
    .code-stat-item .stat-icon svg {
        width: 23px;
        height: 23px;
    }
}

@media (max-width: 480px) {
    .codes-stats-display {
        gap: 10px;
        margin: 15px 0;
    }
    
    .code-stat-item {
        padding: 14px;
        gap: 10px;
        border-radius: 10px;
    }
    
    .code-stat-item .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .code-stat-item .stat-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .code-stat-item .stat-value {
        font-size: 22px;
    }
    
    .code-stat-item .stat-label {
        font-size: 11px;
    }
}

/* ==================== Global Responsive Fixes ==================== */
@media (max-width: 768px) {
    .main-container {
        padding: 20px 10px;
    }
    
    .card {
        max-width: 100%;
        border-radius: 20px;
    }
    
    .section {
        padding: 25px 20px;
    }
    
    .stats-container {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 15px 8px;
    }
    
    .section {
        padding: 20px 15px;
    }
    
    .brand-header {
        margin-bottom: 20px;
    }
    
    .brand-name {
        font-size: 28px;
    }
    
    .brand-tagline {
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .history-section-header {
        padding: 20px 15px;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 10px 8px;
    }
}
