* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-content p {
    margin: 0;
    flex: 1;
}

#accept-cookies {
    background: #007bff;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}

#accept-cookies:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    #accept-cookies {
        margin-top: 10px;
    }
}

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #f8f9fa;
}

/* Language Dropdown */
.language-dropdown {
    position: relative;
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid #e0e6ed;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 2px solid #e2e8f0;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    justify-content: space-between;
}

.lang-dropdown-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    border-color: #007bff;
    color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-1px);
}

.lang-dropdown-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

.lang-name {
    font-weight: 600;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
}

.lang-dropdown-btn:hover .dropdown-arrow {
    color: #007bff;
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.5);
    overflow: hidden;
}

.lang-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 24px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    transform: rotate(45deg);
    border-left: 1px solid rgba(226, 232, 240, 0.5);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.lang-dropdown-item:hover {
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.05) 0%, rgba(0, 123, 255, 0.02) 100%);
    color: #007bff;
    border-left-color: #007bff;
    transform: translateX(2px);
}

.lang-dropdown-item.active {
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 123, 255, 0.05) 100%);
    color: #007bff;
    font-weight: 600;
    border-left-color: #007bff;
}

.lang-dropdown-item.active::after {
    content: '✓';
    margin-left: auto;
    font-weight: bold;
    color: #007bff;
}

.lang-text {
    flex: 1;
}

/* Flag Icons */
.flag {
    display: inline-block;
    width: 20px;
    height: 15px;
    background-size: cover;
    background-position: center;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.1);
}

.flag-en {
    background-image: url('/static/flags/gb.png');
}

.flag-es {
    background-image: url('/static/flags/es.png');
}

.flag-fr {
    background-image: url('/static/flags/fr.png');
}

.flag-de {
    background-image: url('/static/flags/de.png');
}

.flag-it {
    background-image: url('/static/flags/it.png');
}

.flag-pt {
    background-image: url('/static/flags/pt.png');
}

/* Alerts */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

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

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #333;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Form Styling */
.shorten-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.url-input {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
}

.url-input:focus {
    border-color: #007bff;
}

.shorten-btn, .btn {
    padding: 15px 30px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s;
}

.shorten-btn:hover, .btn:hover {
    background: #0056b3;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger {
    background: #dc3545;
}

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

/* Result Display */
.result {
    background: #e8f5e8;
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
}

.result h3 {
    margin-bottom: 15px;
    color: #155724;
}

.shortened-url {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.result-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    background: white;
    font-family: monospace;
}

.copy-btn {
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

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

/* QR Code Section */
.qr-code-section {
    margin-top: 25px;
    text-align: center;
}

.qr-code-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.qr-btn, .qr-download-btn {
    padding: 12px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.qr-btn:hover, .qr-download-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.qr-download-btn {
    background: #6c757d;
}

.qr-download-btn:hover {
    background: #5a6268;
}

.qr-code-container {
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #c3e6cb;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.qr-code-container canvas,
.qr-code-container img {
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.feature {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.feature h3 {
    margin-bottom: 15px;
    color: #333;
}

/* Authentication Forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-form {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.auth-form .form-group {
    display: block;
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
}

.auth-form input:focus {
    border-color: #007bff;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
}

.auth-btn:hover {
    background: #0056b3;
}

.auth-link {
    text-align: center;
    color: #666;
}

.auth-link a {
    color: #007bff;
    text-decoration: none;
}

/* Dashboard */
.dashboard h2 {
    margin-bottom: 30px;
    color: #333;
}

.links-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.links-table table {
    width: 100%;
    border-collapse: collapse;
}

.links-table th,
.links-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.links-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.short-link {
    color: #007bff;
    text-decoration: none;
    font-family: monospace;
}

.original-url {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions {
    display: flex;
    gap: 10px;
}

.actions form {
    display: inline;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Statistics */
.stats-container h2 {
    margin-bottom: 30px;
    color: #333;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #007bff;
}

.stat-url {
    font-size: 14px;
    color: #666;
    word-break: break-all;
}

.stat-date {
    font-size: 16px;
    color: #333;
}

.stats-chart {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.stats-chart h3 {
    margin-bottom: 20px;
    color: #333;
}

.chart-container {
    display: flex;
    align-items: end;
    gap: 10px;
    height: 200px;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bar-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    transform: rotate(-45deg);
    white-space: nowrap;
}

.bar {
    width: 100%;
    max-width: 40px;
    background: #007bff;
    min-height: 2px;
    margin-bottom: 5px;
}

.bar-value {
    font-size: 12px;
    color: #333;
    font-weight: bold;
}

.back-link {
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .shortened-url {
        flex-direction: column;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .links-table {
        overflow-x: auto;
    }
    
    .actions {
        flex-direction: column;
    }
}

.btn-primary {
    background: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

/* Terms of Service */
.terms-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.terms-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.terms-content h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.last-updated {
    color: #666;
    font-style: italic;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.terms-section {
    margin-bottom: 30px;
}

.terms-section h2 {
    color: #007bff;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.terms-section p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #555;
}

.terms-section ul {
    padding-left: 25px;
    margin-bottom: 15px;
}

.terms-section li {
    line-height: 1.8;
    margin-bottom: 8px;
    color: #555;
}

.link-footer {
    color: #007bff; text-decoration: none; margin: 0 10px;
}