/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Nova Paleta - Parque Audicom */
    --primary-purple: #8b5cf6;
    --primary-purple-dark: #7c3aed;
    --aqua-green: #14b8a6;
    --aqua-green-dark: #0d9488;
    --ocean-blue: #0ea5e9;
    --ocean-blue-dark: #0284c7;
    
    /* Cores principais */
    --primary-color: var(--primary-purple);
    --primary-dark: var(--primary-purple-dark);
    --secondary-color: var(--aqua-green);
    --accent-color: var(--ocean-blue);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Cores neutras */
    --light-bg: #fefefe;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Gradientes temáticos */
    --gradient-primary: linear-gradient(135deg, var(--primary-purple) 0%, var(--aqua-green) 50%, var(--ocean-blue) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--aqua-green) 0%, var(--ocean-blue) 100%);
    --gradient-accent: linear-gradient(135deg, var(--primary-purple) 0%, var(--ocean-blue) 100%);
    --gradient-success: linear-gradient(135deg, var(--aqua-green) 0%, var(--success-color) 100%);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(139 92 246 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(139 92 246 / 0.1), 0 2px 4px -2px rgb(139 92 246 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(139 92 246 / 0.15), 0 4px 6px -4px rgb(139 92 246 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(139 92 246 / 0.2), 0 8px 10px -6px rgb(139 92 246 / 0.15);
    --shadow-glow: 0 0 20px rgb(139 92 246 / 0.3);
    
    /* Border radius */
    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    
    /* Transições */
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-primary);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(20, 184, 166, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(14, 165, 233, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    margin: 2rem 0;
    border-radius: var(--border-radius-lg);
    border: 2px solid rgba(139, 92, 246, 0.1);
    overflow: hidden;
    position: relative;
    animation: slideInDown 0.6s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-secondary);
    opacity: 0.05;
    z-index: 0;
}

.header-content {
    padding: 2rem;
    text-align: center;
    background: var(--gradient-primary);
    color: white;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.2));
}

.header h1 i {
    margin-right: 0.75rem;
    color: #fbbf24;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.header p {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Visitors Section */
.visitors-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(20, 184, 166, 0.1);
    overflow: hidden;
    position: relative;
    animation: slideInRight 0.6s ease-out 0.4s both;
}

.visitors-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-secondary);
    z-index: 1;
    animation: slideInLeft 0.8s ease-out 0.6s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.visitors-container {
    padding: 2rem;
}

.visitors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

.visitors-header h2 {
    color: var(--gray-800);
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visitors-header h2 i {
    color: var(--primary-color);
}

.visitors-count {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.visitors-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.visitor-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 250, 251, 0.9) 100%);
    border: 2px solid rgba(139, 92, 246, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    backdrop-filter: blur(10px);
}

.visitor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.visitor-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
}

.visitor-card:hover::before {
    opacity: 1;
}

.visitor-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.visitor-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.visitor-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.visitor-field span {
    font-size: 1rem;
    color: var(--gray-800);
    font-weight: 500;
}

.visitor-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.remove-visitor-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.remove-visitor-btn:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.visitors-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Form Section */
.form-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(139, 92, 246, 0.1);
    overflow: hidden;
    position: relative;
    animation: slideInLeft 0.6s ease-out 0.2s both;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    z-index: 1;
    animation: slideInRight 0.8s ease-out 0.4s both;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.form-container {
    padding: 2rem;
}

.form-container h2 {
    color: var(--gray-800);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

.form-container h2 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.access-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.form-group input,
.form-group select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(249, 250, 251, 1) 100%);
    box-shadow: 
        0 0 0 3px rgba(139, 92, 246, 0.1),
        0 4px 12px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--gray-500);
    font-size: 0.9rem;
    transition: var(--transition);
}

/* Field formatting indicators */
.form-group input:focus::placeholder {
    color: var(--primary-purple);
    opacity: 0.8;
    transform: scale(0.95);
}

/* Age display styling */
.idade-display {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(5, 150, 105, 0.1);
    border-left: 3px solid var(--success-color);
}

/* CPF validation message styling */
.cpf-validation-message {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    min-height: 1.5rem;
}

.cpf-validation-message:not(:empty) {
    background: rgba(5, 150, 105, 0.1);
    border-left: 3px solid var(--success-color);
    animation: slideInFromTop 0.3s ease-out;
}

.cpf-validation-message[style*="color: #dc2626"] {
    background: rgba(220, 38, 38, 0.1) !important;
    border-left: 3px solid var(--danger-color) !important;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Character counter styling */
.char-counter {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 500;
    text-align: right;
    transition: color 0.3s ease;
}

/* Valid field styling */
.form-group input.valid {
    border-color: var(--success-color);
    background-color: #f0fdf4;
}

.form-group input.valid:focus {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Formatting feedback */
.form-group input[data-formatted="true"] {
    border-left: 4px solid var(--success-color);
}

.form-group select[data-formatted="true"] {
    border-left: 4px solid var(--success-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-export,
.btn-danger {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    filter: brightness(1.1);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
    transform: translateY(-1px);
}

.btn-add-user {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.btn-add-user:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-finalize {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.btn-finalize:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-clear {
    background: linear-gradient(135deg, var(--danger-color), #b91c1c);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.btn-clear:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Legal Notice */
.legal-notice {
    margin: 2rem 0 1rem 0;
    animation: slideInUp 0.8s ease-out 0.8s both;
}

.legal-warning {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
    border: 2px solid rgba(220, 38, 38, 0.2);
    border-left: 6px solid var(--danger-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.legal-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--danger-color), #ef4444, var(--danger-color));
    animation: pulse 2s ease-in-out infinite;
}

.legal-warning i {
    color: var(--danger-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
    animation: bounce 1s ease-in-out infinite;
}

.legal-warning p {
    color: var(--gray-700);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.6;
}

.crime-warning {
    color: var(--danger-color) !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.3);
    animation: flash 2s ease-in-out infinite;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
        transform: scale(1.01);
    }
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin: 2rem 0;
    overflow: hidden;
}

.footer-content {
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--gray-600);
}

.footer-content p {
    margin-bottom: 0.25rem;
}

.footer-content i {
    color: var(--danger-color);
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    

}

@media (max-width: 768px) {
    .visitors-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .visitor-info {
        grid-template-columns: 1fr;
    }
    
    .visitors-actions {
        flex-direction: column;
    }
    
    .btn-finalize,
    .btn-clear {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-content,
    .form-container,
    .visitors-container {
        padding: 1.5rem 1rem;
    }
    
    .visitor-card {
        padding: 1rem;
    }
    

}

/* Animações adicionais */
.form-section,
.table-section {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Data Modal Styles */
.data-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.data-modal-overlay.show {
    opacity: 1;
}

.data-modal {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 2px solid rgba(139, 92, 246, 0.1);
    max-width: 800px;
    max-height: 80vh;
    width: 100%;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    position: relative;
}

.data-modal.qr-modal {
    max-width: 500px;
    max-height: 90vh;
}

.data-modal-overlay.show .data-modal {
    transform: scale(1);
}

.data-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 1;
}

.data-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid rgba(139, 92, 246, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(20, 184, 166, 0.05) 100%);
}

.data-modal-header h3 {
    margin: 0;
    color: var(--gray-800);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.data-modal-header h3 i {
    color: var(--primary-purple);
}

.data-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.data-modal-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
    transform: scale(1.1);
}

.data-modal-body {
    padding: 0;
    max-height: 60vh;
    overflow: hidden;
}

.data-tabs {
    display: flex;
    border-bottom: 2px solid rgba(139, 92, 246, 0.1);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(20, 184, 166, 0.05) 100%);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-purple);
}

.tab-btn.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
    background: rgba(139, 92, 246, 0.1);
}

.tab-content {
    display: none;
    padding: 1.5rem 2rem;
    max-height: 45vh;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.encryption-info,
.warning-info {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.encryption-info {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--primary-purple);
}

.warning-info {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.encryption-info i,
.warning-info i {
    margin-right: 0.5rem;
}

.formatted-data {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    margin: 0;
    position: relative;
    overflow-x: auto;
    border: 2px solid;
}

.formatted-data.encrypted {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(88, 28, 135, 0.95) 100%);
    color: #f1f5f9;
    border-color: rgba(139, 92, 246, 0.4);
}

.formatted-data.encrypted::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
    border-radius: 2px 0 0 2px;
}

.formatted-data.original {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.95) 100%);
    color: #f8fafc;
    border-color: rgba(20, 184, 166, 0.4);
}

.formatted-data.original::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-secondary);
    border-radius: 2px 0 0 2px;
}

.data-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid rgba(139, 92, 246, 0.1);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: linear-gradient(135deg, rgba(249, 250, 251, 0.8) 0%, rgba(243, 244, 246, 0.8) 100%);
}

.btn-copy-encrypted,
.btn-copy-original,
.btn-close-modal {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-copy-encrypted {
    background: linear-gradient(135deg, var(--primary-purple), #7c3aed);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-copy-encrypted:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.btn-copy-original {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-copy-original:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.btn-close-modal {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-close-modal:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

/* Responsive modal */
@media (max-width: 768px) {
    .data-modal {
        margin: 0.5rem;
        max-height: 95vh;
        max-width: calc(100vw - 1rem);
    }
    
    .data-modal-header {
        padding: 1rem;
    }
    
    .data-modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .formatted-data {
        font-size: 0.8rem;
        padding: 1rem;
    }
    
    .data-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* QR Code Mobile Optimizations */
    .qr-body {
        padding: 1rem;
    }
    
    .qr-display {
        padding: 1rem;
        min-height: 250px;
        margin-bottom: 1rem;
    }
    
    .qr-display canvas {
        max-width: 100% !important;
        height: auto !important;
        width: auto !important;
    }
    
    .qr-stats {
        gap: 1rem;
        justify-content: space-around;
    }
    
    .stat-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .qr-actions-info {
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .action-item {
        font-size: 0.8rem;
    }
    
    .btn-download-qr {
        padding: 1rem;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .encryption-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .qr-description {
        font-size: 0.9rem;
        text-align: center;
    }
}

/* QR Code Modal Styles */
.qr-body {
    padding: 2rem;
    text-align: center;
}

.qr-info {
    margin-bottom: 2rem;
}

.encryption-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-purple), #7c3aed);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.qr-description {
    color: var(--gray-600);
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qr-container {
    margin: 2rem 0;
}

.qr-display {
    background: linear-gradient(135deg, rgba(249, 250, 251, 0.8) 0%, rgba(243, 244, 246, 0.8) 100%);
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.qr-display.qr-loaded {
    animation: qrAppear 0.6s ease-out;
}

@keyframes qrAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qr-error {
    color: var(--danger-color);
    padding: 2rem;
}

.qr-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.qr-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.9rem;
    background: rgba(139, 92, 246, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.stat-item i {
    color: var(--primary-purple);
}

.qr-actions-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.action-item i {
    color: var(--aqua-green);
}

.btn-download-qr {
    background: var(--gradient-secondary);
    color: white;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn-download-qr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

/* ===== MOBILE OPTIMIZATIONS ===== */

/* Mobile First Improvements */
@media (max-width: 480px) {
    /* Body and Container */
    body {
        font-size: 16px; /* Prevents zoom on iOS */
        -webkit-text-size-adjust: 100%;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    /* Header Mobile */
    .header {
        margin: 1rem 0;
        border-radius: var(--border-radius);
    }
    
    .header-content {
        padding: 1.5rem 1rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    /* Form Mobile Optimizations */
    .form-container {
        padding: 1.5rem 1rem;
        border-radius: var(--border-radius);
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
        border-radius: var(--border-radius);
        min-height: 48px; /* Minimum touch target */
    }
    
    .form-group input:focus,
    .form-group select:focus {
        outline: 2px solid var(--primary-purple);
        outline-offset: 2px;
    }
    
    /* Button Mobile Optimizations */
    button,
    .btn-add-user,
    .btn-secondary,
    .btn-finalize,
    .btn-clear,
    .btn-download-qr {
        min-height: 48px; /* Minimum touch target */
        padding: 0.875rem 1rem;
        border-radius: var(--border-radius);
        font-size: 16px; /* Prevents zoom on iOS */
        touch-action: manipulation; /* Prevents double-tap zoom */
    }
    
    .form-actions {
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .btn-add-user,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    /* Visitors Section Mobile */
    .visitors-container {
        padding: 1.5rem 1rem;
        border-radius: var(--border-radius);
    }
    
    .visitor-card {
        padding: 1rem;
        border-radius: var(--border-radius);
        margin-bottom: 1rem;
    }
    
    .visitor-info {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .visitor-actions {
        margin-top: 1rem;
        gap: 0.5rem;
    }
    
    .btn-remove-visitor {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
    }
    
    /* Legal Notice Mobile */
    .legal-notice {
        padding: 1rem 0;
    }
    
    .legal-warning {
        padding: 1rem;
        border-radius: var(--border-radius);
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .legal-warning i {
        font-size: 1.25rem;
    }
    
    .crime-warning {
        display: block;
        margin-top: 0.5rem;
    }
    
    /* Footer Mobile */
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer-content {
        text-align: center;
        font-size: 0.85rem;
    }
}

/* Very Small Mobile Devices */
@media (max-width: 360px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header-content,
    .form-container,
    .visitors-container {
        padding: 1rem 0.75rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .qr-display {
        padding: 0.75rem;
        min-height: 200px;
    }
    
    .stat-item {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .encryption-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Touch and Accessibility Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    button:hover,
    .btn-add-user:hover,
    .btn-secondary:hover,
    .btn-finalize:hover,
    .btn-clear:hover,
    .btn-download-qr:hover {
        transform: none;
        filter: none;
    }
    
    /* Add tap feedback */
    button:active,
    .btn-add-user:active,
    .btn-secondary:active,
    .btn-finalize:active,
    .btn-clear:active,
    .btn-download-qr:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* Prevent zoom on input focus (iOS Safari) */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
}