/* General Styles */

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gradient: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: #f5f7ff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Section */
.header-section {
    background: var(--gradient);
    color: white;
    text-align: center;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.logo img {
    width: 70%;
    height: auto;
}

.header-section h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header-section p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.2);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

.action-btn i {
    font-size: 1.1rem;
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.card-counter {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.counter-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    transition: all 0.3s ease;
}

.counter-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.3);
}

.counter-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.counter-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.card-header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.card-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.card-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.card-type {
    font-size: 1.1rem;
    color: var(--dark-color);
    font-weight: 500;
}

.qr-container {
    width: 150px;
    height: 150px;
    margin: 15px auto;
    padding: 10px;
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-details {
    margin: 20px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.detail-label {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
}

.detail-value {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.password-field {
    display: none;
}

.toggle-password {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.card-footer {
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.card-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.btn-login,
.btn-barcode,
.btn-save,
.btn-delete {
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.btn-login {
    background: #4CAF50;
    color: white;
}

.btn-barcode {
    background: #2196F3;
    color: white;
}

.btn-save {
    background: #9C27B0;
    color: white;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-login:hover,
.btn-barcode:hover,
.btn-save:hover,
.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.countdown {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #666;
}

.login-error-message {
    background: #ffebee;
    color: #d32f2f;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid #d32f2f;
}

/* Welcome Container */
.welcome-container {
    grid-column: 1 / -1;
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.printer-animation {
    position: relative;
    padding: 30px;
    margin: 20px 0;
}

.printer-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    animation: printing 2s linear infinite;
}

.typewriter-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.description-text {
    color: #666;
    line-height: 1.8;
    text-align: right;
}

.description-text p {
    margin-bottom: 15px;
}

.description-text ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.description-text li {
    margin: 15px 0;
    padding: 12px 15px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    border-right: 3px solid #4CAF50;
    text-align: right;
    transition: all 0.3s ease;
}

.description-text li:hover {
    transform: translateX(-5px);
    background: rgba(76, 175, 80, 0.2);
}

.no-cards-notice {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 5px solid #ffc107;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Modal Styles */
.barcode-modal,
.login-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.barcode-content,
.login-confirm-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
}

.login-confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.confirm-btn,
.cancel-btn {
    padding: 10px 25px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.confirm-btn {
    background: #4CAF50;
    color: white;
}

.cancel-btn {
    background: #f44336;
    color: white;
}

.confirm-btn:hover,
.cancel-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Animations */
@keyframes printing {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .header-section h1 {
        font-size: 1.8rem;
    }

    .card-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    .card {
        visibility: visible;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
    }

    .card * {
        visibility: visible;
    }

    .card-buttons {
        display: none !important;
    }
}
/* أنماط رسائل الخطأ */
.login-error-message {
    background-color: #ffebee;
    color: #d32f2f;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 4px solid #d32f2f;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-error-message svg {
    min-width: 16px;
}

.login-error-message .close-error {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    margin-right: 5px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}



/* Secure Backup Styles */
.secure-backup-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8fafc;
    min-height: 100vh;
}

.secure-backup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: white;
}

.secure-backup-logo {
    display: flex;
    align-items: center;
    gap: 20px;
}

.secure-backup-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.secure-backup-title h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.secure-backup-title p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.secure-backup-indicator {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
}

.secure-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.secure-status i {
    color: #4caf50;
}

.secure-backup-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.backup-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-top: 5px solid;
}

.backup-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.backup-card.encrypted {
    border-color: #1a237e;
}

.backup-card.normal {
    border-color: #1565c0;
}

.backup-card.restore {
    border-color: #2e7d32;
}

.backup-card-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 30px;
    color: white;
}

.backup-card.encrypted .backup-card-icon {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

.backup-card.normal .backup-card-icon {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
}

.backup-card.restore .backup-card-icon {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
}

.backup-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.backup-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.secure-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
    color: white;
}

.backup-card.encrypted .secure-btn {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

.backup-card.normal .secure-btn {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
}

.backup-card.restore .secure-btn {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
}

.secure-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.secure-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.file-upload-wrapper {
    margin: 20px 0;
}

.file-upload-label {
    display: block;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.file-upload-label:hover {
    border-color: #1976d2;
    background: rgba(25, 118, 210, 0.05);
}

.file-upload-label i {
    margin-left: 10px;
}

#restoreBackupInput {
    display: none;
}

#selectedFileName {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.secure-status-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.secure-backup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.secure-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secure-back-btn:hover {
    background: #d32f2f;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #666;
}

.security-badge i {
    color: #1a237e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .secure-backup-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .secure-backup-content {
        grid-template-columns: 1fr;
    }

    .secure-backup-footer {
        flex-direction: column-reverse;
        gap: 20px;
    }
}

/* Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.backup-card:hover .backup-card-icon {
    animation: pulse 1.5s infinite;
}


