/*
 * style.css - Styling for Blank Eats Arizona Food Blog & Tracker
 * A premium, modern, and adventurous design with desert sunset hues.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Syne:wght@700;800&display=swap');

:root {
    /* Color Palette - Desert Sunset & Night Sky */
    --bg-dark: #0f1115;
    --bg-card: #181b22;
    --bg-input: #21252e;
    --border-color: #2c313d;
    --border-hover: #434a5c;
    
    --primary: #d35400; /* Terracotta Orange */
    --primary-glow: rgba(211, 84, 0, 0.4);
    --accent-orange: #ff7619; /* Hot Sun Orange */
    --accent-gold: #f39c12; /* Sun Gold */
    --accent-gold-glow: rgba(243, 156, 18, 0.3);
    
    --success-sage: #6b8e23; /* Desert Sage Green */
    --danger-red: #e74c3c;
    
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(211, 84, 0, 0.25);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 80px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Typography Helpers */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

/* Header Banner - Phoenix Skyline */
.hero-banner {
    position: relative;
    height: 480px;
    width: 100%;
    background-image: linear-gradient(to bottom, rgba(15, 17, 21, 0.3), rgba(15, 17, 21, 0.95)), url('phoenix_skyline.png');
    background-size: cover;
    background-position: center 60%;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(transparent, var(--bg-dark));
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    z-index: 2;
    animation: fadeInDown 1s var(--transition-smooth);
}

.logo-container {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 10;
}

.logo-img {
    height: 100px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.5));
    transition: transform 0.5s var(--transition-smooth);
}

.logo-img:hover {
    transform: scale(1.05) rotate(1deg);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Main Container Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: -60px;
    margin-bottom: 50px;
    position: relative;
    z-index: 10;
}

.stat-card {
    background: rgba(24, 27, 34, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-premium);
    transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--accent-orange);
    font-family: var(--font-heading);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

/* Controls & Filter Bar */
.control-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-premium);
}

.search-filter-group {
    display: flex;
    gap: 15px;
    flex: 1;
    min-width: 300px;
}

.search-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.filter-select {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    min-width: 150px;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--primary);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-orange) 100%);
    color: var(--text-primary);
    border: none;
    padding: 14px 28px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 15px rgba(211, 84, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 84, 0, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Grid Layout for Logs */
.logs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    min-height: 300px;
}

.no-logs-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    color: var(--text-secondary);
}

.no-logs-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Restaurant Log Card */
.log-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
    animation: fadeInUp 0.5s var(--transition-smooth);
}

.log-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.card-image-wrapper {
    position: relative;
    height: 240px;
    width: 100%;
    background-color: var(--bg-input);
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--transition-smooth);
}

.log-card:hover .card-img {
    transform: scale(1.08);
}

.card-tags {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.tag-cuisine {
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(4px);
    color: var(--accent-orange);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 20px;
    border: 1px solid rgba(211, 84, 0, 0.3);
}

.tag-city {
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(4px);
    color: var(--text-primary);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.card-rating-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-orange) 100%);
    color: var(--bg-dark);
    font-weight: 800;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Card Body Content */
.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.25;
}

.card-meal-container {
    background: var(--bg-input);
    border-left: 3px solid var(--primary);
    padding: 8px 12px;
    margin-bottom: 16px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.meal-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.meal-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.card-review {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: auto;
}

.card-stars {
    color: var(--accent-gold);
    font-size: 0.9rem;
    display: flex;
    gap: 2px;
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    color: var(--danger-red);
    background-color: rgba(231, 76, 60, 0.1);
}

/* Modal - Log Restaurant Form */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-close:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

/* Form Styles */
.modal-body {
    padding: 24px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Star Rating Selector */
.rating-picker-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rating-stars-input {
    display: flex;
    flex-direction: row-reverse; /* Allows hover selection behavior */
    justify-content: flex-end;
    gap: 6px;
}

.rating-stars-input input {
    display: none;
}

.rating-stars-input label {
    font-size: 1.75rem;
    color: var(--border-hover);
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.rating-stars-input label:hover,
.rating-stars-input label:hover ~ label,
.rating-stars-input input:checked ~ label {
    color: var(--accent-gold);
    transform: scale(1.1);
}

.rating-stars-input label:active {
    transform: scale(0.9);
}

/* Image Upload Area */
.image-upload-zone {
    border: 2px dashed var(--border-color);
    padding: 24px;
    border-radius: var(--border-radius-md);
    text-align: center;
    cursor: pointer;
    background: var(--bg-input);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
    position: relative;
}

.image-upload-zone:hover, .image-upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(211, 84, 0, 0.05);
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upload-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.upload-preview {
    margin-top: 15px;
    position: relative;
    max-height: 180px;
    overflow: hidden;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    display: none;
}

.upload-preview img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.remove-preview-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 17, 21, 0.85);
    border: none;
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color var(--transition-fast);
}

.remove-preview-btn:hover {
    background-color: var(--danger-red);
}

/* Form Footer Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Profile Header Badge */
.profile-container {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 10;
}

.btn-auth-trigger {
    background: rgba(24, 27, 34, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-auth-trigger:hover {
    background: rgba(24, 27, 34, 0.9);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(211, 84, 0, 0.2);
}

.profile-badge {
    background: rgba(24, 27, 34, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    padding: 6px 14px 6px 8px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-premium);
}

.profile-avatar {
    font-size: 1.25rem;
    background: var(--bg-input);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-signout {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 5px;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-signout:hover {
    color: var(--danger-red);
    background-color: rgba(231, 76, 60, 0.1);
}

/* Avatar Emoji Picker Grid */
.avatar-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.avatar-selector input {
    display: none;
}

.avatar-selector label {
    font-size: 2rem;
    padding: 10px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    text-align: center;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-selector label:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background-color: rgba(255,255,255,0.02);
}

.avatar-selector input:checked + label {
    border-color: var(--primary);
    background-color: rgba(211, 84, 0, 0.1);
    box-shadow: 0 0 15px rgba(211, 84, 0, 0.2);
    transform: scale(1.05);
}

/* Card Author Badge Style */
.card-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    align-self: flex-start;
}

.author-avatar-icon {
    font-size: 0.95rem;
}

.author-name-text {
    color: var(--text-secondary);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -40px;
    }
}

@media (max-width: 768px) {
    .profile-container {
        top: 20px;
        left: 20px;
    }
    .logo-container {
        top: 20px;
        right: 20px;
    }
    .logo-img {
        height: 65px;
    }
    .hero-banner {
        height: 350px;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .control-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-filter-group {
        flex-direction: column;
    }
    .btn-primary {
        justify-content: center;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .profile-container {
        top: 15px;
        left: 15px;
    }
    .profile-name {
        display: none;
    }
    .profile-badge {
        padding: 4px;
    }
    .logo-container {
        top: 15px;
        right: 15px;
    }
    .logo-img {
        height: 50px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .container {
        padding: 0 16px;
    }
    .hero-banner {
        height: 280px;
    }
    .hero-title {
        font-size: 2rem;
    }
    .card-image-wrapper {
        height: 200px;
    }
}
