/* Modern Reset and Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

/* App Container */
.app-container {
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand i {
    font-size: 1.75rem;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--secondary);
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary);
    color: white;
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Generator Grid */
.generator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header p {
    color: var(--secondary);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group label i {
    color: var(--primary);
    width: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--light);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[type="color"] {
    width: 100px;
    height: 45px;
    padding: 5px;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

/* Preview Sticky */
.preview-sticky {
    position: sticky;
    top: 100px;
}

/* Business Card Preview */
.card-preview {
    margin-bottom: 2rem;
}

.business-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.card-front {
    position: relative;
    padding: 2rem;
    min-height: 300px;
}

.card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary);
}

.card-content {
    margin-top: 1rem;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.profile-info h3 {
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.profile-info p {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--secondary);
}

.contact-item i {
    width: 20px;
    color: var(--primary);
}

/* QR Code Display */
.qr-code-display {
    padding: 1rem;
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.qr-code-display img {
    max-width: 200px;
    height: auto;
}

.qr-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

/* Admin Styles */
.admin-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary);
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--primary);
}

/* Admin Dashboard */
.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    background: var(--light);
}

.admin-sidebar {
    background: white;
    border-right: 1px solid var(--border);
    padding: 1.5rem;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.sidebar-header i {
    font-size: 1.75rem;
    color: var(--primary);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--dark);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--secondary);
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--primary);
    color: white;
}

.sidebar-link.logout {
    margin-top: auto;
    color: var(--danger);
}

.sidebar-link.logout:hover {
    background: var(--danger);
    color: white;
}

.admin-main {
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    font-size: 1.75rem;
    color: var(--dark);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--secondary);
}

.admin-user i {
    font-size: 2rem;
    color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: #eff6ff;
    color: #2563eb;
}

.stat-icon.green {
    background: #f0fdf4;
    color: #10b981;
}

.stat-icon.purple {
    background: #faf5ff;
    color: #8b5cf6;
}

.stat-info h3 {
    font-size: 1.5rem;
    color: var(--dark);
}

.stat-info p {
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Admin Card */
.admin-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.admin-card-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-card-body {
    padding: 1.5rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 1rem;
    background: var(--light);
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.admin-table tbody tr:hover {
    background: var(--light);
}

.badge {
    background: #eff6ff;
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: none;
    background: var(--light);
    color: var(--secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
}

.btn-icon.delete:hover {
    background: var(--danger);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-sticky {
        position: static;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-menu {
        justify-content: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-container {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-preview,
.qr-result {
    animation: fadeIn 0.5s ease;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .navbar,
    .form-section,
    .qr-actions,
    .hidden {
        display: none !important;
    }
    
    .generator-grid {
        grid-template-columns: 1fr;
    }
    
    .card-preview {
        box-shadow: none;
    }
}