/* Global Styles */
:root {
    --primary-color: #DCAF0E;
    --background-dark: #1F1D2B;
    --card-background: #2D2F3E;
    --text-light: #ffffff;
    --text-grey: #888888;
    --red: #e74c3c;
    --green: #27ae60;
    --orange: #e67e22;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

/* Header */
/* Header Styles */
header {
    background-color: #10111D; /*var(--background-dark);*/
    color: white;
    padding: 1rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container .logo {
    background-color: var(--primary-color);
    color: var(--background-dark);
    /*padding: 5px 10px;
    border-radius: 4px;
    margin-right: 10px;
    font-weight: bold;*/
}

.logo-container .logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: var(--text-grey);
    text-decoration: none;
    transition: color 0.3s;
}

nav ul li a:hover, 
nav ul li a.active {
    color: var(--primary-color);
}

.auth-buttons {
    display: flex;
    align-items: center;
}

.btn-login, 
.btn-register {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    margin-left: 10px;
    transition: all 0.3s;
}

.btn-login {
    border: 1px solid var(--text-grey);
    color: white;
    background: transparent;
}

.btn-register {
    background-color: var(--primary-color);
    color: var(--background-dark);
    font-weight: bold;
}

.btn-login:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-register:hover {
    background-color: #c69d0c;
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-profile span {
    margin-right: 15px;
    color: white;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--text-grey);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--background-dark);
    color: white;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-grey);
}

/* Specials Section */
.specials-container {
    padding: 2rem 0;
}

.specials-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--background-dark);
    font-size: 2rem;
}

.specials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.special-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.special-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.special-header {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background-color: var(--background-dark);
    color: white;
}

.retailer {
    background-color: var(--primary-color);
    color: black;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

.category {
    color: var(--text-grey);
    font-size: 0.9rem;
}

.days-left {
    font-size: 0.9rem;
}

.days-left.sponsored {
    border: 1px solid var(--text-grey);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.special-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--card-background);
    color: white;
    position: relative;
    min-height: 250px;
}

.save-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: black;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.special-content.saved {
    /*background-color: rgba(220, 175, 14, 0.15);*/
    border: 2px solid var(--primary-color);
}

.product-image {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.special-content h3 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 5px 0;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-grey);
    font-size: 1rem;
}

.end-date {
    margin-top: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-grey);
}

.special-actions {
    display: flex;
    justify-content: space-around;
    padding: 15px 10px;
    background-color: white;
}

.btn-action {
    background: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1rem;
    transition: color 0.3s;
}

.btn-action span {
    font-size: 0.8rem;
    margin-top: 4px;
}

.like-btn:hover, .like-btn.active {
    color: var(--red);
}

.like-btn.active i {
    font-weight: 900;
}

.comment-btn:hover {
    color: var(--primary-color);
}

.add-to-list-btn:hover {
    color: var(--orange);
}

.share-btn:hover {
    color: var(--primary-color);
}

.load-more {
    text-align: center;
    margin-top: 2rem;
}

.btn-load-more {
    background-color: var(--primary-color);
    color: black;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-load-more:hover {
    background-color: #c69d0c;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
}

.auth-form {
    margin-top: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: black;
    font-weight: 500;
    border-radius: 4px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.btn-submit:hover {
    background-color: #c69d0c;
}

.form-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.form-text a {
    color: var(--primary-color);
    font-weight: 500;
}

/* Footer */
footer {
    background-color: var(--background-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    color: var(--text-grey);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        margin-top: 15px;
    }
    
    .auth-buttons {
        margin-top: 15px;
    }
    
    .specials-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

/* Pagination Styles */
.pagination-container {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    margin: 0 5px;
    border-radius: 5px;
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: #e9ecef;
}

.page-link.active {
    background-color: #007bff;
    color: white;
    cursor: default;
}

.page-ellipsis {
    margin: 0 5px;
    color: #6c757d;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
}

.page-link.prev,
.page-link.next {
    padding: 0 15px;
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 200px;
    color: #6c757d;
    font-size: 1.2rem;
}

.loading-indicator i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: #333;
    color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-info {
    background-color: #17a2b8;
}

@media (max-width: 480px) {
    .specials-grid {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    nav ul li {
        margin-left: 12px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

.save-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.save-btn.active {
    color: var(--primary-color);
}

.save-btn i {
    font-size: 1.2em;
}

.promotion-container {
    margin: 20px 0;
    text-align: center;
}

.promotion-container .special-card {
    max-width: 400px;
    margin: 0 auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Style for the save button when active (saved) */
.btn-action.save-btn.active {
    background-color: #FFC107;
    color: #000;
}

/* Style for the save badge */
.special-content .save-badge {
    background-color: #FFC107;
    color: #000;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Categories Page Styles */
body.dark-theme {
    background-color: #121212;
    color: #ffffff;
}

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

.categories-container h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.categories-subtitle {
    color: var(--text-grey);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-card {
    background-color: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    padding: 1.25rem;
}

.category-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.category-name {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

.interaction-count {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.category-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-grey);
    margin-bottom: 24px;
    font-size: 15px;
}

.btn-view-promotions {
    width: 100%;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 14px;
    border-radius: 30px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-view-promotions:hover {
    background-color: rgba(220, 175, 14, 0.1);
}

.notification-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(45, 47, 62, 0.9);
    padding: 16px 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    z-index: 100;
}

/* Back button styling */
.back-button {
    color: var(--primary-color);
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    text-decoration: none;
}

.back-button i {
    margin-right: 8px;
}

/* Override for dark theme */
.dark-theme .category-card {
    background-color: #2D2F3E;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-grey);
}

/* Ensure search results tabs are styled consistently */
.search-results-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    border-radius: 4px;
    color: #333;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-button:hover {
    background-color: #f0f0f0;
}

.tab-button.active {
    background-color: var(--primary-color);
    color: var(--background-dark);
    border-color: var(--primary-color);
}

/* Style for retailer cards */
.retailer-card .special-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--card-background);
    color: white;
    min-height: 150px;
}

.retailer-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.retailer-card p {
    color: var(--text-grey);
    font-size: 0.9rem;
}

/* Ensure search results count is styled */
#search-results-count {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-grey);
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-results-tabs {
        flex-direction: column;
        align-items: center;
    }

    .tab-button {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
}
