/* Kaharagia MRZ Generator - Shared Styles */

@font-face {
    font-family: 'OCRB';
    src: url('/public/OCRB.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #febc0a 0%, #b22222 50%, #121212 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    overflow-y: scroll;
}

/* Fixed Container System */
.container {
    width: 1200px;
    max-width: calc(100vw - 40px);
    min-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

/* Ensure Font Awesome icons display */
.fas, .fa {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 8px;
    display: inline-block;
}

.header .fas {
    color: #febc0a;
    margin-right: 12px;
}

/* Header Styling */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Navigation Menu */
.nav-menu {
    background: rgba(255,255,255,0.95);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.nav-menu a:hover {
    background: rgba(254, 188, 10, 0.2);
}

.nav-menu a.active {
    background: linear-gradient(45deg, #febc0a, #b22222);
    color: white;
}

#adminNav {
    display: none;
}

/* Main Content Grids */
.main-content, .admin-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

/* Content Sections */
.form-section, .output-section, .admin-section {
    background: rgba(255,255,255,0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    min-height: 600px;
    width: 100%;
    box-sizing: border-box;
}

.form-section h2, .output-section h2, .admin-section h2 {
    margin-bottom: 20px;
    color: #121212;
    border-bottom: 3px solid #febc0a;
    padding-bottom: 10px;
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #febc0a;
    box-shadow: 0 0 0 3px rgba(254, 188, 10, 0.1);
}

/* Password Input with Toggle */
.password-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-group input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 16px;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.password-toggle:hover {
    color: #febc0a;
    background: rgba(254, 188, 10, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Button Styles */
.btn, .generate-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover, .generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-primary, .generate-btn {
    background: linear-gradient(45deg, #febc0a, #b22222);
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.generate-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    margin-top: 20px;
    justify-content: center;
}

/* Login Screen Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #febc0a 0%, #b22222 50%, #121212 100%);
    background-attachment: fixed;
}

.login-box {
    background: rgba(255,255,255,0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #121212;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 0.9em;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: #febc0a;
    box-shadow: 0 0 0 3px rgba(254, 188, 10, 0.1);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #febc0a, #b22222);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.login-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    border: 1px solid #f5c6cb;
}

/* MRZ Display Styles */
.mrz-display {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.2;
    white-space: pre;
    min-height: 80px;
    margin-bottom: 15px;
}

.mrz-canvas-container {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 10px;
    min-height: 200px;
    max-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mrz-canvas {
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    width: 600px;
    height: 165px;
    object-fit: contain;
    max-width: 600px;
    flex-shrink: 0;
}

.download-section {
    margin-top: 15px;
    text-align: center;
}

.download-btn {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background: #218838;
}

/* User Management Styles */
.user-list {
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info h4 {
    margin-bottom: 5px;
    color: #121212;
}

.user-info p {
    color: #666;
    font-size: 0.9em;
}

.user-actions {
    display: flex;
    gap: 5px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    display: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Edit User Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255,255,255,0.98);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #febc0a;
}

.modal-header h3 {
    color: #121212;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.modal-close:hover {
    color: #b22222;
}

/* Info Section */
.info-section {
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.info-section h3 {
    color: #b22222;
    margin-bottom: 10px;
}

.help-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* Footer Styles */
.copyright-footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    font-size: 0.95em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.copyright-text {
    flex: 1;
    text-align: center;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.footer-nav a i {
    margin-right: 6px;
}

.logout-btn {
    background: rgba(178, 34, 34, 0.8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    background: rgba(178, 34, 34, 1);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 1240px) {
    .container {
        width: calc(100vw - 40px);
        min-width: auto;
        padding: 15px;
    }
    
    .mrz-canvas {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .container {
        width: calc(100vw - 20px);
        min-width: auto;
        padding: 10px;
    }
    
    .main-content, .admin-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2em;
    }

    .mrz-canvas {
        width: 100%;
        max-width: 400px;
    }

    .login-box {
        margin: 20px;
        padding: 30px;
    }

    .form-section, .output-section, .admin-section {
        min-height: auto;
    }
    
    .copyright-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .copyright-text {
        order: 1;
    }

    .nav-menu {
        padding: 10px;
    }

    .nav-menu a {
        display: block;
        margin: 5px 0;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}