* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
}

/* Dog House Page Styles - Navbar is loaded from /common/navbar.css */

.main-container {
    max-width: 1200px;
    margin: 80px auto 40px;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #00ff88, #00cc6f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    font-size: 1.2rem;
    color: #aaa;
}

.category-section {
    margin-bottom: 60px;
}

.section-header {
    font-size: 2rem;
    color: #00ff88;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

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

.topic-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.topic-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.topic-button:hover::before {
    left: 100%;
}

.topic-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.topic-button:active {
    transform: translateY(-2px);
}

.topic-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.topic-info {
    text-align: left;
    flex: 1;
}

.topic-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #fff;
}

.topic-info p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.category-content {
    max-width: 1000px;
}

.topic-content {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #00ff88;
}

.modal-header h2 {
    color: #00ff88;
    font-size: 2rem;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.btn-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-back:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Category Controls */
.category-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-create-topic {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6f 100%);
    color: #1a1a2e;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn-create-topic:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
}

.sort-controls {
    display: flex;
    gap: 10px;
}

.sort-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sort-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
}

/* Topics List */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.topic-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.topic-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
    transform: translateX(5px);
}

.topic-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.topic-item-title {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 5px;
}

.topic-item-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.9rem;
    color: #aaa;
}

.topic-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.premium-badge-small {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: bold;
}

.topic-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #aaa;
}

.stat.upvotes {
    color: #00ff88;
}

.stat.downvotes {
    color: #ff4444;
}

.topic-item-content {
    color: #ccc;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Topic View */
.topic-view {
    padding: 20px 0;
}

.topic-detail {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.topic-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.topic-detail-title {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 15px;
}

.topic-detail-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    color: #aaa;
    font-size: 0.9rem;
}

.topic-detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ddd;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.topic-vote-section {
    display: flex;
    gap: 15px;
    align-items: center;
}

.vote-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.vote-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.vote-btn.upvoted {
    background: #00ff88;
    color: #1a1a2e;
    border-color: #00ff88;
}

.vote-btn.downvoted {
    background: #ff4444;
    color: #fff;
    border-color: #ff4444;
}

.vote-score {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

/* Comments Section */
.comments-section {
    margin-top: 40px;
}

.comments-header {
    color: #00ff88;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #00ff88;
}

.comment-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 15px;
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.comment-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.comment-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-username {
    font-weight: bold;
    color: #fff;
}

.comment-time {
    color: #aaa;
    font-size: 0.9rem;
}

.comment-content {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.comment-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-vote-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-vote-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.comment-vote-btn.upvoted {
    color: #00ff88;
}

.comment-vote-btn.downvoted {
    color: #ff4444;
}

/* Create Topic Modal */
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-body input,
.modal-body textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 15px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
}

.modal-body input:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid #aaa;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-submit {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6f 100%);
    color: #1a1a2e;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.loading {
    text-align: center;
    color: #aaa;
    padding: 40px;
    font-size: 1.2rem;
}

.no-topics {
    text-align: center;
    color: #aaa;
    padding: 40px;
}

.no-topics p {
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .topics-grid {
        grid-template-columns: 1fr;
    }

    .category-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-controls {
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .topic-detail-title {
        font-size: 1.5rem;
    }
}
