/* Reset și bază */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #4a7fb3;
    --primary-light: #5b9cd6;
    --primary-dark: #2c4d6e;
    --secondary-color: #f8f9fa;
    --text-color: #2c3e50;
    --text-light: #e2e8f0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --header-height: 60px;
    --sidebar-width: 250px;
    --transition-speed: 0.3s;
    --container-width-xl: 95%;
    --container-width-xxl: 90%;
}

body {
    background-color: #eef2f5;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-color);
    width: 100%;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4a7fb3, #5b9cd6);
    color: white;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    height: var(--header-height);
}

.navbar {
    padding: 0 0.5rem;
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0 auto;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    background: transparent;
    cursor: pointer;
    display: block;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.logo-img {
    max-height: 35px;
    width: auto;
}

.user-header-info {
    margin-left: auto;
    color: white;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* Selector de limbă cu steaguri - Design modern și plăcut */
.language-flags {
    display: flex;
    gap: 8px;
    margin-left: 20px;
    align-items: center;
}

.flag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    min-width: 44px;
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.flag-btn::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;
}

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

.flag-btn:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.flag-btn.active {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.flag-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Efecte speciale pentru steaguri */
.flag-btn[title="Română"] {
    background: linear-gradient(135deg, rgba(0, 43, 127, 0.2), rgba(206, 17, 38, 0.2));
}

.flag-btn[title="English"] {
    background: linear-gradient(135deg, rgba(1, 33, 105, 0.2), rgba(200, 16, 46, 0.2));
}

.flag-btn[title="Română"]:hover {
    background: linear-gradient(135deg, rgba(0, 43, 127, 0.3), rgba(206, 17, 38, 0.3));
}

.flag-btn[title="English"]:hover {
    background: linear-gradient(135deg, rgba(1, 33, 105, 0.3), rgba(200, 16, 46, 0.3));
}

/* Responsive pentru steaguri */
@media (max-width: 768px) {
    .language-flags {
        margin-left: 10px;
        gap: 6px;
    }
    
    .flag-btn {
        font-size: 1.2rem;
        padding: 6px 10px;
        min-width: 38px;
        min-height: 38px;
    }
}

/* Main container */
.wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #4a7fb3, #5b9cd6);
    color: white;
    height: calc(100vh - var(--header-height));
    position: fixed;
    top: var(--header-height);
    left: calc(-1 * var(--sidebar-width));
    z-index: 900;
    overflow-y: auto;
    transition: left var(--transition-speed) ease;
    box-shadow: var(--shadow-md);
}

.sidebar.show {
    left: 0;
}

.sidebar .nav-link {
    color: var(--text-light);
    padding: 0.75rem 1rem;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.sidebar .nav-link.active {
    border-left: 3px solid white;
    font-weight: 500;
}

.user-info {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 0;
}

/* Conținut */
.content {
    flex: 1;
    width: 100%;
    transition: margin-left var(--transition-speed) ease;
    padding: 0.5rem;
}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, #4a7fb3, #5b9cd6);
    color: var(--text-light);
    text-align: center;
    padding: 0.75rem 0;
    margin-top: auto;
    width: 100%;
}

.footer-container {
    padding: 0 1rem;
    max-width: 1600px;
    margin: 0 auto;
}

.site-footer p {
    margin: 0;
    font-size: 0.875rem;
}

/* Carduri */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    text-align: center;
}

/* Clase specifice pentru pontaj.php */
.qr-container {
    max-width: 350px;
    margin: 0 auto;
}

.qr-video {
    width: 100%;
    height: auto;
    max-height: 350px;
    display: none;
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.cod-display {
    max-width: 350px;
    margin: 0 auto;
    text-align: center;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    padding: 10px;
}

.timer {
    font-size: 2.5rem;
    color: var(--danger-color);
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.scan-btn {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s, transform 0.2s;
}

.scan-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Asigurăm compatibilitatea cu Bootstrap */
.btn {
    /* Păstrăm doar stilurile tale esențiale, dar permitem Bootstrap să controleze funcționalitatea */
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #1877f2;
    border-color: #1877f2;
    color: white;
}

.btn-primary:hover {
    background-color: #155db1;
    border-color: #155db1;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

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

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Asigurăm vizibilitatea modalului */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

/* Media Queries */
@media (min-width: 768px) {
    .container {
        padding: 1.5rem;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 1400px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1600px;
        width: var(--container-width-xl);
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 2000px;
        width: var(--container-width-xxl);
    }
}

@media (max-width: 767.98px) {
    .content {
        padding: 0.25rem;
    }
    .container {
        padding: 0.75rem;
        border-radius: 0.375rem;
    }
    .sidebar.show {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding: 0.5rem;
        border-radius: 0.25rem;
    }
}