/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Page routing styles */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Main Landing Page Styles */
.oxxo-billboard {
    position: relative;
    min-height: 100vh;
    background-color: #e70020;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Yellow stripes */
.yellow-stripe {
    position: absolute;
    width: 100%;
    height: 60px;
    background: linear-gradient(45deg, #fbb110 0%, #fbb110 50%, #fbb110 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.yellow-stripe.top {
    top: 0;
    border-bottom: 3px solid #E8B000;
}

.yellow-stripe.bottom {
    bottom: 0;
    border-top: 3px solid #E8B000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer logos container */
.footer-logos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
}

.oxxo-footer-logo {
    height: 30px;
    width: auto;
}

/* White stripes */
.white-stripe {
    position: absolute;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: white;
    z-index: 1;
}

.white-stripe.top {
    top: 60px;
}

.white-stripe.bottom {
    bottom: 60px;
}

/* Main content */
.billboard-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 80px 20px;
    max-width: 1200px;
    width: 100%;
}

/* OXXO Logo */
.oxxo-logo {
    margin-bottom: 30px;
    width: 100%;
    max-width: 120px;
    margin: 0 auto 30px auto;
}

.oxxo-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0.6px 1.2px rgba(0, 0, 0, 0.045));
}

.phrase-container {
    margin-bottom: 40px;
    padding: 30px;
}

.phrase-text {
    font-family: 'Ubuntu', sans-serif;
    font-size: clamp(1rem, 2.8vw, 2.5rem);
    font-weight: 700;
    color: white;
    text-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.075);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
    white-space: nowrap;
    overflow: visible;
}

/* Mobile vertical adjustments */
@media (max-width: 768px) and (orientation: portrait) {
    .phrase-text {
        font-size: clamp(0.9rem, 4vw, 1.8rem);
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 90vw;
        line-height: 1.1;
    }
    
    .phrase-container {
        padding: 20px 15px;
        margin-bottom: 30px;
    }
    
    .billboard-content {
        padding: 60px 15px;
    }
}

/* Button styles */
.button-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.action-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Titillium Web', sans-serif;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 160px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.action-btn.primary {
    background: #fbb110;
    color: #E60012;
}

.action-btn.primary:hover {
    background: #FFC107;
}

.action-btn.secondary {
    background: white;
    color: #E60012;
}

.action-btn.secondary:hover {
    background: #f5f5f5;
}

.action-btn.whatsapp {
    background: #25D366;
    color: white;
}

.action-btn.whatsapp:hover {
    background: #20B954;
}

/* Admin link */
.admin-link {
    margin-top: 20px;
}

.admin-link a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.admin-link a:hover {
    color: white;
    text-decoration: underline;
}

/* Admin Panel Styles */
.admin-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h1 {
    color: #E60012;
    font-weight: 800;
    font-size: 2rem;
}

.back-link {
    color: #E60012;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 20px;
    border: 2px solid #E60012;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: #E60012;
    color: white;
}

.admin-header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

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

.admin-content {
    display: grid;
    gap: 30px;
}

.admin-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 1.5rem;
}

/* Form styles */
.phrase-form {
    max-width: 600px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Titillium Web', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #E60012;
    box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.1);
}

/* Phrases list styles */
.phrases-stats {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 600;
    color: #666;
}

.phrases-list {
    display: grid;
    gap: 15px;
}

.phrase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #E60012;
    gap: 15px;
}

.phrase-item.custom {
    border-left-color: #FFD700;
}

.phrase-text-item {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.phrase-type {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phrase-type.default {
    background: #E60012;
    color: white;
}

.phrase-type.custom {
    background: #FFD700;
    color: #333;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.3s ease;
}

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

.delete-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-weight: 600;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #FFD700;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Bulk actions styles */
.bulk-actions {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

.bulk-action-group {
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
}

.bulk-action-group.danger {
    border-color: #dc3545;
    background: #fff5f5;
}

.bulk-action-group h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.bulk-action-group p {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

#bulk-import-text {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Titillium Web', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 15px;
}

#bulk-import-text:focus {
    outline: none;
    border-color: #E60012;
    box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.1);
}

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

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

/* Phrases filter */
.phrases-filter {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.phrases-filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
}

.phrases-filter input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #E60012;
}

/* Phrase actions */
.phrase-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

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

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

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

/* Login styles */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #E60012 0%, #FF4444 100%);
    padding: 20px;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

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

.form-group input:focus {
    outline: none;
    border-color: #E60012;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #E60012;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background: #c50010;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    border: 1px solid #f5c6cb;
}

.error-message.hidden {
    display: none;
}

/* Featured phrase styles */
.phrase-item.featured {
    background: linear-gradient(135deg, #fff9c4, #fff);
    border-left: 4px solid #ffd700;
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.3);
}

.phrase-item.featured .phrase-type {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
    font-weight: bold;
}

/* Feature button styles */
.feature-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
    font-size: 1.2em;
    transition: all 0.2s ease;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}

.feature-btn:hover {
    background: #fff3cd;
    border-color: #ffd700;
    color: #856404;
    transform: translateY(-1px);
}

.feature-btn.featured {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
    border-color: #ffd700;
    font-weight: bold;
}

.feature-btn.featured:hover {
    background: linear-gradient(135deg, #ffed4a, #ffd700);
    transform: scale(1.05) translateY(-1px);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #999;
}

/* Responsive design */
@media (max-width: 768px) {
    .yellow-stripe {
        height: 40px;
    }

    .billboard-content {
        padding: 60px 15px;
    }

    .oxxo-logo {
        max-width: 200px;
        margin-bottom: 20px;
    }

    .phrase-container {
        padding: 20px;
        margin-bottom: 30px;
    }

    .phrase-text {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .action-btn {
        width: 100%;
        max-width: 280px;
        padding: 12px 25px;
        font-size: 1rem;
    }

    .admin-header {
        flex-direction: column;
        text-align: center;
    }

    .admin-header h1 {
        font-size: 1.5rem;
    }

    .admin-section {
        padding: 20px;
    }

    .phrase-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .phrase-text-item {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .phrase-text {
        font-size: clamp(1.2rem, 7vw, 2rem);
    }

    .admin-content {
        gap: 20px;
    }

    .admin-section {
        padding: 15px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .phrase-container {
        background: rgba(255, 255, 255, 0.95);
        border: 3px solid white;
    }
    
    .phrase-text {
        color: #E60012;
        text-shadow: none;
    }
}

/* Mekamun logo styles in yellow stripe */
.yellow-stripe.bottom {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    padding: 5px;
}

.bolt {
    fill: black;
    transition: fill 0.3s ease;
}

.logo-link:hover .bolt {
    fill: #E60012; /* OXXO red */
}

.kommuna-text path {
    fill: black;
}

.kommuna-by path {
    fill: black;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .action-btn {
        transition: none;
    }
    
    .action-btn:hover {
        transform: none;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .footer-link {
        transition: none;
    }
    
    .footer-link:hover {
        transform: none;
    }
}
