/* Base styles */
:root {
    --primary-color: #FFB344;
    --secondary-color: #E05D5D;
    --accent-color: #70B77E;
    --background-color: #F7F3E3;
    --text-color: #2D3436;
    --card-background: #FFFFFF;
    --shadow-color: rgba(45, 52, 54, 0.1);
    --rating-color: #FFB344;
}

body {
    font-family: 'Poppins', system-ui, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Header styles */
header {
    background: var(--card-background);
    padding: 1rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-background);
    border-radius: 24px;
    margin: 2rem auto;
    max-width: 1200px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

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

.hero p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 2rem;
}

/* Restaurant cards */
.restaurant-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.restaurant-card {
    position: relative;
    background: var(--card-background);
    border-radius: 24px;
    overflow: visible;
    box-shadow: 0 8px 32px var(--shadow-color);
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.restaurant-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 48px var(--shadow-color);
}

.restaurant-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    text-decoration: none;
    color: inherit;
}

.rank-badge {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(255, 179, 68, 0.3);
    z-index: 2;
}

.rank-1 { background: var(--primary-color); }
.rank-2 { background: var(--secondary-color); }
.rank-3 { background: var(--accent-color); }

.image-container {
    position: relative;
    height: 100%;
    min-height: 280px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rating {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(45, 52, 54, 0.9);
    color: var(--rating-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.content {
    padding: 2rem;
    position: relative;
}

.content h2 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color);
}

.content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
    font-size: 1.1rem;
}

/* Vegan meter */
.vegan-meter {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vegan-label {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 1rem;
    font-weight: 500;
}

.vegan-dots {
    display: flex;
    gap: 6px;
}

.dot {
    color: #E2E8F0;
    font-size: 1.4rem;
    line-height: 1;
}

.dot.active {
    color: var(--accent-color);
}

/* Upvote section */
.upvote-section {
    position: absolute;
    right: 2rem;
    top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.upvote-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--text-color);
    opacity: 0.5;
    padding: 0.5rem;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.upvote-button:hover:not(:disabled) {
    opacity: 1;
    transform: translateY(-2px);
    background: white;
    box-shadow: 0 4px 16px var(--shadow-color);
    color: var(--primary-color);
}

.upvote-button.voted {
    color: var(--primary-color);
    opacity: 1;
    cursor: default;
}

.votes-count {
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Location search */
.location-search {
    margin: 2rem 0;
}

.search-container {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-container input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 179, 68, 0.2);
}

.search-button,
.location-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location-button {
    background: var(--accent-color);
    padding: 0 1rem;
}

.search-button:hover,
.location-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.icon {
    font-size: 1.2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .restaurant-content {
        grid-template-columns: 1fr;
    }

    .image-container {
        height: 200px;
    }

    .content {
        padding: 1.5rem;
    }

    .search-container {
        flex-direction: column;
    }

    .search-button,
    .location-button {
        width: 100%;
        justify-content: center;
    }

    .rank-badge {
        top: -8px;
        left: -8px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Submit page styles */
.submit-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.submit-header {
    text-align: center;
    margin-bottom: 3rem;
}

.submit-header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.submit-header p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1.2rem;
}

.submit-form {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 179, 68, 0.2);
}

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

.form-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: #F8FAFC;
    border: 2px dashed #E2E8F0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: var(--primary-color);
    background: #FFF9F0;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-image:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.error-message {
    background: var(--secondary-color);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .submit-page {
        margin: 1rem auto;
    }

    .submit-header h1 {
        font-size: 2rem;
    }

    .submit-form {
        padding: 1.5rem;
    }

    .form-group input[type="file"] {
        padding: 0.5rem;
    }

    .image-preview {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}