/* ========================================
   Minque Clone - Base Stylesheet
   ======================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', 'Yu Gothic', 'YuGothic', 'Meiryo', sans-serif;
    color: #333;
    background-color: #f8f9fa;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.main-nav {
    display: flex;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #007bff;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: 0.3s;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Search Section */
.search-section {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #0056b3;
}

.search-options {
    display: flex;
    gap: 1rem;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Content Layout */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.content-main {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Category List */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-link {
    display: block;
    padding: 0.5rem;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.category-link:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* Ranking */
.ranking-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.ranking-tab {
    flex: 1;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ranking-tab.active {
    background-color: #007bff;
    color: white;
}

.ranking-tab:hover:not(.active) {
    background-color: #f8f9fa;
}

/* Question List */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-item {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.question-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.question-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.question-title a {
    color: #333;
    text-decoration: none;
}

.question-title a:hover {
    color: #007bff;
}

.question-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.question-category {
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

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

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Footer */
.footer {
    background-color: #333;
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
}

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

.footer-link {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .search-options {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .question-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    .search-section {
        padding: 1rem;
    }
    
    .content-main,
    .sidebar-section {
        padding: 1rem;
    }
}

/* Home Page Styles */
.welcome-section {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.welcome-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.7;
    opacity: 0.95;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-secondary {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
    background-color: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.home-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f8f9fa;
}

.section-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.2rem;
}

.section-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.section-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.question-item {
    position: relative;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.question-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
    transform: translateY(-2px);
}

.question-header {
    margin-bottom: 1rem;
}

.question-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.question-link {
    display: block;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.question-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.question-link:hover {
    color: #007bff;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.question-category {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.question-content {
    margin-bottom: 1rem;
}

.question-excerpt {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f8f9fa;
}

.question-stats {
    display: flex;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: #666;
}

.stat-icon {
    font-size: 1rem;
}

.stat-count {
    font-weight: 500;
}

.question-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.question-author {
    color: #495057;
    font-weight: 600;
}

.question-time {
    color: #999;
}

/* Answered Questions Section */
.answered-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answered-item {
    position: relative;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.answered-item:hover {
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40,167,69,0.15);
}

.answered-content {
    flex: 1;
}

.answered-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.answered-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.answered-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.answered-link:hover {
    color: #28a745;
}

.answered-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.answered-author {
    color: #495057;
    font-weight: 600;
}

.meta-separator {
    color: #ccc;
}

.answered-date {
    color: #28a745;
    font-weight: 500;
}

.answered-stats {
    margin-left: 1rem;
}

.answered-count {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.answered-count-number {
    font-size: 1.1rem;
    margin-right: 0.25rem;
}

.answered-count-label {
    font-size: 0.8rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-message {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Float Action Button */
.float-action {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,123,255,0.4);
    transition: all 0.3s ease;
}

.float-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,123,255,0.5);
}

.float-icon {
    font-size: 1.5rem;
}

/* Responsive Styles for Home Page */
@media (max-width: 768px) {
    .welcome-section {
        padding: 2rem 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.8rem;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-large {
        width: 100%;
        max-width: 300px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .question-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .question-date {
        align-items: flex-start;
    }
    
    .answered-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .answered-stats {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .float-action {
        display: block;
        bottom: 1rem;
        right: 1rem;
    }
    
    .float-btn {
        width: 50px;
        height: 50px;
    }
    
    .float-icon {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .welcome-section {
        padding: 1.5rem 1rem;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .welcome-description {
        font-size: 1rem;
    }
    
    .question-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .question-item {
        padding: 1rem;
    }
    
    .answered-item {
        padding: 0.75rem 1rem;
    }
}

/* IU016: ランキング・カテゴリモーダル機能 */

/* Modal Base Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

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

.modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Ranking Modal Styles */
.ranking-modal .modal-container {
    width: 800px;
}

.ranking-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f8f9fa;
}

.ranking-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

.ranking-tab:hover {
    color: #007bff;
    background: #f8f9fa;
}

.ranking-tab.active {
    color: #007bff;
    background: #f8f9fa;
}

.ranking-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #007bff;
    border-radius: 2px 2px 0 0;
}

/* Ranking Content Separation: サイドバー vs モーダル */
/* サイドバー用ランキングコンテンツ */
.sidebar-ranking-content {
    display: block; /* 常に表示 */
}

/* モーダル用ランキングコンテンツ */
.ranking-content {
    display: none;
}

.ranking-content.active {
    display: block;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.ranking-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    min-width: 60px;
    text-align: center;
}

.ranking-rank.rank-1 {
    color: #ffd700;
}

.ranking-rank.rank-2 {
    color: #c0c0c0;
}

.ranking-rank.rank-3 {
    color: #cd7f32;
}

.ranking-question {
    flex: 1;
    margin-left: 1rem;
}

.ranking-question-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.3s ease;
}

.ranking-question-title:hover {
    color: #007bff;
}

.ranking-question-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.ranking-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ranking-stat-icon {
    font-size: 1rem;
}

.ranking-stat-value {
    font-weight: 600;
}

.ranking-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.ranking-empty-message {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Category Modal Styles */
.category-modal .modal-container {
    width: 600px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.category-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    border-color: #007bff;
    background: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.category-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.category-count-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
    margin-right: 0.25rem;
}

.category-stats {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.category-stats-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.category-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.category-stat-card {
    background: #e3f2fd;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.category-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.25rem;
}

.category-stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Modal Trigger Buttons */
.modal-trigger {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.modal-trigger:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.modal-trigger.secondary {
    background: #6c757d;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.modal-trigger.secondary:hover {
    background: #5a6268;
}

/* Sidebar Modal Trigger Actions */
.category-actions,
.ranking-actions {
    margin-bottom: 1rem;
}

.category-more,
.ranking-more {
    margin-top: 1rem;
    text-align: center;
}

.modal-trigger.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Loading State */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #666;
}

.modal-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: modal-spin 1s linear infinite;
    margin-right: 1rem;
}

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

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .modal-container {
        width: 95vw;
        max-height: 85vh;
        margin: 0 2.5vw;
    }
    
    .ranking-modal .modal-container,
    .category-modal .modal-container {
        width: 95vw;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .ranking-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .ranking-tab {
        padding: 0.75rem;
        border-bottom: 1px solid #e9ecef;
    }
    
    .ranking-tab:last-child {
        border-bottom: none;
    }
    
    .ranking-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .ranking-rank {
        align-self: flex-end;
        min-width: auto;
    }
    
    .ranking-question {
        margin-left: 0;
        width: 100%;
    }
    
    .ranking-question-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .category-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 80px);
    }
    
    .ranking-item {
        padding: 0.75rem;
    }
    
    .ranking-rank {
        font-size: 1.2rem;
    }
    
    .category-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
.modal-overlay:focus {
    outline: none;
}

.modal-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.ranking-tab:focus,
.category-card:focus,
.modal-trigger:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Animation for modal content loading */
.modal-content-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* サイドバー用ランキングリスト */
.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ranking-item {
    margin-bottom: 0.5rem;
}

.ranking-link {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
}

.ranking-link:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.ranking-rank {
    display: inline-block;
    font-weight: bold;
    color: #007bff;
    margin-right: 0.5rem;
    min-width: 20px;
    text-align: center;
}

.ranking-title {
    font-weight: 500;
    margin-right: 0.5rem;
    line-height: 1.3;
}

.ranking-views {
    font-size: 0.8rem;
    color: #666;
    margin-left: auto;
    white-space: nowrap;
}

.ranking-empty {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-none { display: none; }
.d-block { display: block; }

/* IU012: いいね・共感機能アニメーション */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.like-btn, .sympathy-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.like-btn:hover, .sympathy-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
}

.like-btn:disabled, .sympathy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.like-count, .sympathy-count {
    font-weight: 600;
    margin-left: 0.25rem;
}

.interaction-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    align-items: center;
}

.answer-interactions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f8f9fa;
    margin-top: 1rem;
}

.question-interactions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f8f9fa;
}

/* Loading & States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Search Form Styles */
.home-search-form {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.search-input {
    flex: 2;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-select {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: white;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Search Results Page Styles */
.search-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.search-header h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1rem;
}

.search-condition {
    margin-top: 1rem;
}

.search-condition p {
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
}

.condition-tag {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.search-form-container .search-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.search-form .form-group {
    margin-bottom: 1rem;
}

.search-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.search-form input[type="text"],
.search-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-form input[type="text"]:focus,
.search-form select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-type-options {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.search-type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.search-type-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.search-results {
    margin-top: 2rem;
}

.results-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    color: #1565c0;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.error-messages {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.error-messages ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.error-messages li {
    color: #721c24;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.error-messages li:last-child {
    margin-bottom: 0;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
}

.pagination-link {
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.pagination-link:hover {
    background: #0056b3;
}

.pagination-info {
    font-weight: 600;
    color: #666;
}

/* Responsive Search Styles */
@media (max-width: 768px) {
    .search-header h2 {
        font-size: 1.5rem;
    }
    
    .condition-tag {
        display: block;
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .search-type-options {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination-link {
        width: 100%;
        text-align: center;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .results-info {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .no-results {
        padding: 2rem 1rem;
    }
}

/* ========================================
   Common Page Styles
   ======================================== */

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.page-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.page-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

.page-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* ========================================
   Question List Page Styles
   ======================================== */

.question-list-wrapper {
    padding: 0;
}

.question-count {
    color: #666;
    font-size: 0.95rem;
}

.question-count strong {
    color: #007bff;
    font-weight: 600;
}

/* ========================================
   Question Detail Page Styles
   ======================================== */

.question-detail-wrapper {
    padding: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #ccc;
}

.breadcrumb-current {
    color: #333;
    font-weight: 500;
}

.question-detail {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.question-detail .question-header {
    margin-bottom: 1.5rem;
}

.question-detail .question-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
    color: #333;
    margin-top: 0.75rem;
}

.question-detail .question-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.question-detail .question-date {
    color: #666;
    font-size: 0.9rem;
}

.question-text {
    line-height: 1.8;
    color: #333;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.question-detail .question-author {
    color: #666;
    font-size: 0.95rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.question-detail .question-author .author-name {
    color: #495057;
    font-weight: 600;
}

.question-detail .question-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.question-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-sympathy,
.btn-share,
.btn-like,
.btn-reply {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-sympathy:hover,
.btn-like:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
}

.btn-share:hover,
.btn-reply:hover {
    border-color: #007bff;
    color: #007bff;
    background: #f0f7ff;
}

/* Answers Section */
.answers-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.answers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.answers-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.answer-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.5rem;
    background: #007bff;
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.answer-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.sort-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #333;
    background: #fff;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-answers {
    text-align: center;
    padding: 2rem;
    color: #666;
    background: #f8f9fa;
    border-radius: 6px;
}

.no-answers p {
    margin: 0.5rem 0;
}

/* Answer Item */
.answer-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e9ecef;
}

.answer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-text {
    line-height: 1.7;
    color: #333;
    font-size: 0.95rem;
}

.answer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.answer-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

.answer-author .author-name {
    color: #495057;
    font-weight: 600;
}

.answer-date {
    color: #999;
    font-size: 0.85rem;
}

.answer-actions {
    display: flex;
    gap: 0.5rem;
}

.like-count {
    font-weight: 600;
}

/* Answer Form Section */
.answer-form-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f8f9fa;
}

.answer-form-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.answer-form .form-group {
    margin-bottom: 1.25rem;
}

.answer-form .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.answer-form .form-label.required::after {
    content: ' *';
    color: #dc3545;
}

.answer-form .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
}

.answer-form .form-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.answer-form .form-input {
    width: 100%;
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
}

.answer-form .form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.answer-form .form-help {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.answer-form .form-actions {
    margin-top: 1.5rem;
}

/* Related Questions */
.related-questions {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.related-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f8f9fa;
}

.related-list {
    color: #666;
}

.coming-soon {
    text-align: center;
    padding: 1rem;
    color: #999;
    font-size: 0.9rem;
}

/* 関連質問リストアイテム */
.related-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.related-item:last-child {
    border-bottom: none;
}

.related-item:hover {
    background-color: #f8f9fa;
}

.related-item-title {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
    margin-right: 1rem;
}

.related-item:hover .related-item-title {
    color: #007bff;
}

.related-item-meta {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #999;
    white-space: nowrap;
}

.no-related {
    text-align: center;
    padding: 1rem;
    color: #999;
    font-size: 0.9rem;
}

/* Comments Section */
.comments-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #e9ecef;
}

.comment-item {
    background: #fff;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border-left: 3px solid #007bff;
}

.comment-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 0.5rem;
}

.comment-meta {
    font-size: 0.8rem;
    color: #666;
}

.comment-author {
    color: #495057;
    font-weight: 600;
    margin-right: 0.5rem;
}

.comment-date {
    color: #999;
}

.comment-post-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 6px;
}

.comment-post-form .form-actions {
    display: flex;
    gap: 0.5rem;
}

.comment-post-form .form-actions .btn {
    flex: 1;
}

.comment-form-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.no-comments {
    text-align: center;
    padding: 0.75rem;
    color: #999;
    font-size: 0.85rem;
}

/* Button Sizes */
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Icon definitions for detail page */
.icon-view::before {
    content: '👁';
}

.icon-sympathy::before {
    content: '🤝';
}

.icon-like::before {
    content: '👍';
}

.icon-share::before {
    content: '🔗';
}

/* Share Dropdown */
.share-dropdown {
    position: relative;
    display: inline-block;
}

.share-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 100;
}

.share-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.share-item:hover {
    background-color: #f8f9fa;
}

.share-item:first-child {
    border-radius: 8px 8px 0 0;
}

.share-item:last-child {
    border-radius: 0 0 8px 8px;
}

.share-twitter:hover { color: #1DA1F2; }
.share-line:hover { color: #00B900; }
.share-facebook:hover { color: #1877F2; }
.share-copy:hover { color: #007bff; }

.icon-twitter::before { content: 'X'; font-weight: bold; }
.icon-line::before { content: 'L'; font-weight: bold; font-family: sans-serif; }
.icon-facebook::before { content: 'f'; font-weight: bold; font-family: serif; }
.icon-copy::before { content: '[]'; font-size: 0.8em; }
.icon-share-native::before { content: '->'; }

@media (max-width: 480px) {
    .share-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        margin: 0;
        border-radius: 16px 16px 0 0;
        min-width: auto;
    }

    .share-item {
        padding: 1rem 1.25rem;
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error {
    text-align: center;
    padding: 1rem;
    color: #dc3545;
    background: #f8d7da;
    border-radius: 6px;
}

/* Responsive for Question Detail */
@media (max-width: 768px) {
    .question-detail {
        padding: 1rem;
    }

    .question-detail .question-title {
        font-size: 1.25rem;
    }

    .answers-section {
        padding: 1rem;
    }

    .answers-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .answer-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .question-actions {
        flex-wrap: wrap;
    }

    .related-questions {
        padding: 1rem;
    }

    .related-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .related-item-title {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .question-detail .question-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .btn-sympathy,
    .btn-share,
    .btn-like,
    .btn-reply {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .answer-item {
        padding: 1rem;
    }
}

.category-badge {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========================================
   Question Form Page Styles
   ======================================== */

.question-form-wrapper {
    padding: 0;
}

.question-form {
    background: #fff;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert h4 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-list li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.error-list li:last-child {
    margin-bottom: 0;
}

/* ========================================
   Question Answer List Page Styles
   ======================================== */

.question-answer-list-wrapper {
    padding: 0;
}

.question-answer-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-questions {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-questions-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-questions-content h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.no-questions-content p {
    color: #666;
    margin-bottom: 1.5rem;
}

.no-questions-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.question-answer-item {
    position: relative;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.question-answer-item:hover {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.question-answer-header {
    margin-bottom: 1rem;
}

.answer-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.new-answer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.latest-answer-date {
    color: #666;
    font-size: 0.9rem;
}

.question-answer-content {
    margin-bottom: 1rem;
}

.question-answer-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.question-answer-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.question-answer-title a:hover {
    color: #28a745;
}

.question-answer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f8f9fa;
}

.answer-stats {
    display: flex;
    gap: 1rem;
}

.answer-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: #666;
}

.answer-stats .stat-item.primary {
    color: #28a745;
    font-weight: 500;
}

.answer-stats .stat-value {
    font-weight: 600;
}

.answer-stats .stat-label {
    font-size: 0.85rem;
}

.answer-actions {
    display: flex;
    gap: 0.5rem;
}

.list-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f8f9fa;
}

.footer-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.footer-info {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.7;
}

.btn-outline {
    background: transparent;
    border: 2px solid #007bff;
    color: #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}

/* Icon definitions with emoji */
.icon-comment-large,
.icon-new,
.icon-comment,
.icon-eye,
.icon-list,
.icon-plus {
    display: inline-block;
}

.icon-new::before {
    content: '🆕';
}

.icon-comment::before {
    content: '💬';
}

.icon-comment-large::before {
    content: '💬';
    font-size: 2rem;
}

.icon-eye::before {
    content: '👁';
}

.icon-list::before {
    content: '📋';
}

.icon-plus::before {
    content: '➕';
}

/* Responsive Styles for Additional Pages */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }

    .breadcrumb {
        flex-wrap: wrap;
    }

    .question-answer-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .footer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .no-questions-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding-bottom: 0.75rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .question-answer-item {
        padding: 1rem;
    }

    .answer-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ========================================
   Search Results Page Additional Styles
   ======================================== */

.search-results-wrapper {
    padding: 0;
}

.condition-label {
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
}

.no-results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .no-results-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* ========================================
   Question List Page - Filter/Sort Controls
   ======================================== */

.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #333;
    background: #fff;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Question Item Styles for List Page */
.question-item-header {
    margin-bottom: 0.75rem;
}

.question-item-content {
    margin-bottom: 1rem;
}

.question-item-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.question-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.question-item-title a:hover {
    color: #007bff;
}

.question-item-excerpt {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.question-item-author {
    font-size: 0.9rem;
    color: #666;
}

.question-item-author .author-name {
    color: #495057;
    font-weight: 600;
}

.question-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

/* Pagination Styles */
.pagination-nav {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f8f9fa;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-number:hover {
    border-color: #007bff;
    color: #007bff;
    background: #f0f7ff;
}

.pagination-number.current {
    background: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: 600;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: #999;
}

.pagination-prev,
.pagination-next {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.icon-arrow-left::before {
    content: '<';
}

.icon-arrow-right::before {
    content: '>';
}

.icon-question-large::before {
    content: '?';
    font-size: 2rem;
}

/* Button Large */
.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ========================================
   Question Form Page - Notice & Validation
   ======================================== */

.form-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.notice-title {
    font-size: 1rem;
    font-weight: 600;
    color: #856404;
    margin-bottom: 0.75rem;
}

.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notice-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #856404;
    line-height: 1.5;
}

.notice-list li::before {
    content: '!';
    position: absolute;
    left: 0;
    top: 0;
    width: 1rem;
    height: 1rem;
    background: #856404;
    color: #fff3cd;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notice-list li:last-child {
    margin-bottom: 0;
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.char-counter.error {
    color: #dc3545;
    font-weight: 500;
}

/* Form Validation Error States */
.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-input.error:focus,
.form-textarea.error:focus,
.form-select.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* Form Select Base Styles */
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    color: #333;
    background: #fff;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* ========================================
   Home Page - Section Styles
   ======================================== */

.welcome-section {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-content {
    max-width: 600px;
    margin: 0 auto;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.welcome-description {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.welcome-actions .btn-primary {
    background: white;
    color: #007bff;
}

.welcome-actions .btn-primary:hover {
    background: #f8f9fa;
}

.welcome-actions .btn-secondary {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.welcome-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.home-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.question-section,
.answered-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.25rem;
}

.section-link {
    color: #007bff;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.section-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.empty-message {
    color: #666;
    margin-bottom: 1rem;
}

.meta-separator {
    color: #ccc;
}

.answered-stats {
    display: flex;
    align-items: center;
}

.answered-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #28a745;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    min-width: 60px;
}

.answered-count-number {
    font-size: 1.25rem;
    font-weight: 700;
}

.answered-count-label {
    font-size: 0.7rem;
}

/* ========================================
   Search Results - Form Container
   ======================================== */

.search-form-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-form-container .search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-type-options {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.search-type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
}

.search-type-option input[type="radio"] {
    accent-color: #007bff;
}

/* Responsive for New Styles */
@media (max-width: 768px) {
    .list-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls,
    .sort-controls {
        justify-content: space-between;
    }

    .question-item-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .welcome-section {
        padding: 1.5rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .welcome-actions {
        flex-direction: column;
    }

    .question-section,
    .answered-section {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .answered-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .float-action {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .search-type-options {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .pagination-number {
        min-width: 1.75rem;
        height: 1.75rem;
        font-size: 0.85rem;
    }

    .welcome-section {
        padding: 1.25rem;
    }

    .welcome-title {
        font-size: 1.25rem;
    }

    .welcome-description {
        font-size: 0.95rem;
    }

    .btn-large {
        padding: 0.6rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* =====================================================
   Error Pages
===================================================== */
.error-page .error-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-page .error-code {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-page.error-404 .error-code {
    color: #6c757d;
}

.error-page.error-500 .error-code {
    color: #dc3545;
}

.error-page .error-icon {
    font-size: 3rem;
    color: #ffc107;
    margin-bottom: 1rem;
}

.error-page .error-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.error-page .error-message {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-page .error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-page .btn {
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
}

.error-page .btn-primary {
    background: #007bff;
    color: #fff;
}

.error-page .btn-secondary {
    background: #6c757d;
    color: #fff;
}

.error-page .btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.error-page .debug-section {
    margin-top: 2rem;
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.error-page .debug-details {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
}

.error-page .debug-toggle {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 700;
    color: #495057;
    background: #e9ecef;
    border-radius: 4px 4px 0 0;
    margin: 0;
    user-select: none;
}

.error-page .debug-toggle:hover {
    background: #dee2e6;
}

.error-page .debug-content {
    padding: 1rem;
    background: #fff;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
}

.error-page .debug-content pre {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #495057;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.home-error-section {
    padding: 60px 0;
    text-align: center;
}

.home-error-content {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.home-error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.home-error-title {
    font-size: 24px;
    color: #495057;
    margin-bottom: 15px;
}

.home-error-message {
    color: #6c757d;
    margin-bottom: 30px;
    line-height: 1.6;
}

.home-error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .error-page .error-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .error-page .error-code {
        font-size: 3rem;
    }

    .error-page .error-actions {
        flex-direction: column;
    }
}
