/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #4a6bff;
    --primary-dark: #3a56cc;
    --secondary-color: #ff6b6b;
    --secondary-dark: #cc5656;
    --text-color: #333;
    --text-light: #666;
    --background-color: #f9f9f9;
    --card-color: #fff;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --error-color: #f44336;
    --positive-color: #4caf50;
    --negative-color: #f44336;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --bottom-nav-height: 60px;
    --header-height: 60px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header Styles */
header {
    background-color: var(--card-color);
    box-shadow: var(--shadow);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo span {
    margin-left: 0.5rem;
}

/* Desktop Navigation (hidden on mobile) */
.desktop-nav {
    display: none;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
}

.bottom-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--bottom-nav-height);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem;
    width: 33.333%;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Main Content */
main {
    flex: 1;
    padding: 1rem 0 2rem;
}

.page-title {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-color);
}

/* Sort Controls */
.sort-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.sort-controls button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.sort-controls button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Hot Takes List */
.hot-takes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hot-take {
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
    transition: var(--transition);
    animation: fadeIn 0.5s ease-in-out;
    cursor: pointer;
}

.hot-take:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.hot-take-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.hot-take-category {
    background-color: rgba(74, 107, 255, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.hot-take-id {
    font-size: 0.75rem;
    color: var(--text-light);
}

.hot-take-text {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.hot-take-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-buttons {
    display: flex;
    gap: 0.5rem;
}

.vote-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.vote-btn.agree {
    color: var(--positive-color);
}

.vote-btn.disagree {
    color: var(--negative-color);
}

.vote-btn.agree:hover:not(:disabled),
.vote-btn.agree:active:not(:disabled) {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: var(--positive-color);
}

.vote-btn.disagree:hover:not(:disabled),
.vote-btn.disagree:active:not(:disabled) {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: var(--negative-color);
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vote-btn.voted {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.vote-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

.vote-count.positive {
    color: var(--positive-color);
}

.vote-count.negative {
    color: var(--negative-color);
}

/* Hot Take Detail Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--card-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 92%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    margin-bottom: var(--bottom-nav-height);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover,
.modal-close:active {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.modal-header {
    margin-bottom: 1.25rem;
}

.modal-category {
    display: inline-block;
    background-color: rgba(74, 107, 255, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.modal-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.modal-content {
    margin-bottom: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

/* Submit Form */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: right;
    margin-top: 0.25rem;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn:hover,
.btn:active {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover,
.btn-secondary:active {
    background-color: var(--secondary-dark);
}

/* Interstitial Ad */
.interstitial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.interstitial-overlay.active {
    opacity: 1;
    visibility: visible;
}

.interstitial-container {
    background-color: var(--card-color);
    border-radius: 12px;
    width: 92%;
    max-width: 600px;
    padding: 1.25rem;
    text-align: center;
}

.interstitial-header {
    margin-bottom: 1rem;
}

.interstitial-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.interstitial-content {
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.interstitial-footer {
    display: flex;
    justify-content: center;
}

.skip-ad-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--text-light);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.skip-ad-btn:hover,
.skip-ad-btn:active {
    background-color: var(--text-color);
}

.skip-ad-timer {
    margin-right: 0.5rem;
}

/* Ad Containers */
.ad-container {
    margin: 1.5rem 0;
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

/* Footer */
footer {
    background-color: var(--card-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    margin-top: auto;
    margin-bottom: var(--bottom-nav-height);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.875rem;
}

.footer-links a:hover,
.footer-links a:active {
    color: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 0.5s;
}

/* Responsive Styles */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
    
    .header-content {
        justify-content: space-between;
    }
    
    .desktop-nav {
        display: block;
    }
    
    .desktop-nav ul {
        display: flex;
        list-style: none;
    }
    
    .desktop-nav li {
        margin-left: 1.5rem;
    }
    
    .desktop-nav a {
        color: var(--text-color);
        text-decoration: none;
        font-weight: 500;
        transition: var(--transition);
    }
    
    .desktop-nav a:hover {
        color: var(--primary-color);
    }
    
    .bottom-nav {
        display: none;
    }
    
    .hot-takes {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .hot-take {
        padding: 1.5rem;
    }
    
    .hot-take:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .page-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .btn {
        width: auto;
    }
    
    footer {
        margin-bottom: 0;
    }
    
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}