/* Enhanced Heisei-style CSS */

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

body {
    font-family: "MS Gothic", "ＭＳ ゴシック", "Osaka", monospace;
    font-size: 12px;
    line-height: 1.4;
    background-color: #f5f5f5;
    color: #000000;
    background-image: linear-gradient(45deg, #f5f5f5 25%, transparent 25%), 
                      linear-gradient(-45deg, #f5f5f5 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f5f5f5 75%), 
                      linear-gradient(-45deg, transparent 75%, #f5f5f5 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    background-color: #ffffff;
    border: 2px solid #cccccc;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 5px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid #000080;
    background: linear-gradient(to bottom, #ffffff, #e8f4f8);
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.header h1 {
    font-size: 24px;
    font-weight: bold;
    color: #191970;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    font-family: "MS Gothic", monospace;
}

.subtitle {
    font-size: 14px;
    color: #4682b4;
    margin-bottom: 10px;
    font-weight: bold;
}

.header-info {
    font-size: 11px;
    color: #666666;
    background-color: #f0f0f0;
    padding: 8px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    margin-top: 10px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

/* Navigation */
.navigation {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f8f8;
    border: 2px solid #cccccc;
    text-align: center;
    border-radius: 5px;
}

.nav-link {
    color: #0000ff;
    text-decoration: none;
    padding: 0 10px;
    font-size: 12px;
}

.nav-link:visited {
    color: #800080;
}

.nav-link:hover {
    text-decoration: underline;
    background-color: #e0e0e0;
}

/* Main Content */
.main-content {
    margin-bottom: 20px;
}

/* Thread Creation */
.thread-creation {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #cccccc;
}

.thread-creation h2 {
    font-size: 16px;
    color: #000080;
    margin-bottom: 15px;
    border-bottom: 1px solid #000080;
    padding-bottom: 5px;
}

/* Form Styles */
.form-table {
    width: 100%;
    border-collapse: collapse;
}

.form-label {
    width: 80px;
    font-weight: bold;
    vertical-align: top;
    padding: 5px;
    background-color: #f0f0f0;
    border: 1px solid #cccccc;
}

.form-table input[type="text"],
.form-table textarea {
    font-family: "MS Gothic", "ＭＳ ゴシック", monospace;
    font-size: 12px;
    border: 1px solid #999999;
    padding: 3px;
    background-color: #ffffff;
}

.form-table input[type="text"]:focus,
.form-table textarea:focus {
    border-color: #000080;
    outline: none;
}

.format-help {
    margin-top: 5px;
    font-size: 10px;
    color: #666666;
}

.format-help button {
    font-family: "MS Gothic", "ＭＳ ゴシック", monospace;
    font-size: 10px;
    padding: 2px 5px;
    margin: 0 2px;
    background-color: #e0e0e0;
    border: 1px solid #999999;
    cursor: pointer;
}

.format-help button:hover {
    background-color: #d0d0d0;
}

button[type="submit"],
button[type="reset"] {
    font-family: "MS Gothic", "ＭＳ ゴシック", monospace;
    font-size: 12px;
    padding: 3px 10px;
    margin-right: 10px;
    background-color: #e0e0e0;
    border: 1px solid #999999;
    cursor: pointer;
}

button[type="submit"]:hover,
button[type="reset"]:hover {
    background-color: #d0d0d0;
}

/* Thread List */
.thread-list {
    margin-bottom: 20px;
}

.thread-list h2 {
    font-size: 16px;
    color: #000080;
    margin-bottom: 10px;
    border-bottom: 1px solid #000080;
    padding-bottom: 5px;
}

.thread-stats {
    margin-bottom: 10px;
    padding: 5px;
    background-color: #f0f0f0;
    border: 1px solid #cccccc;
}

.thread-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    border: 2px solid #000080;
    background-color: #ffffff;
}

.thread-table th {
    background-color: #191970;
    color: #ffffff;
    padding: 6px;
    text-align: left;
    border: 1px solid #000080;
    font-weight: bold;
    font-size: 11px;
}

.thread-table td {
    padding: 6px;
    border: 1px solid #cccccc;
    vertical-align: top;
    font-size: 11px;
}

.thread-table tr:nth-child(even) {
    background-color: #f5f5f5;
}

.thread-table tr:hover {
    background-color: #ffffcc;
    cursor: pointer;
}

.thread-link {
    color: #0000ff;
    text-decoration: none;
}

.thread-link:visited {
    color: #800080;
}

.thread-link:hover {
    text-decoration: underline;
}

.thread-status {
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}

.thread-status.sticky {
    color: #ff0000;
}

.thread-status.locked {
    color: #808080;
}

.thread-status.normal {
    color: #000000;
}

/* Thread View */
.thread-view {
    margin-bottom: 20px;
}

.thread-header {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #cccccc;
}

.back-button {
    font-family: "MS Gothic", "ＭＳ ゴシック", monospace;
    font-size: 12px;
    padding: 3px 8px;
    margin-bottom: 10px;
    background-color: #e0e0e0;
    border: 1px solid #999999;
    cursor: pointer;
}

.back-button:hover {
    background-color: #d0d0d0;
}

.thread-header h2 {
    font-size: 18px;
    color: #000080;
    margin-bottom: 5px;
}

.thread-info {
    font-size: 11px;
    color: #666666;
}

/* Posts */
.posts-container {
    margin-bottom: 30px;
}

.post {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-left: 3px solid #000080;
}

.post-header {
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
    color: #666666;
}

.post-number {
    font-weight: bold;
    color: #000080;
    margin-right: 10px;
}

.post-name {
    font-weight: bold;
    color: #008000;
    margin-right: 10px;
}

.post-date {
    color: #666666;
    margin-right: 10px;
}

.post-id {
    color: #ff6600;
    font-weight: bold;
}

.post-content {
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-content blockquote {
    margin: 5px 0;
    padding: 5px 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #cccccc;
    color: #666666;
}

.post-content .quote {
    color: #0000ff;
    text-decoration: none;
}

.post-content .quote:visited {
    color: #800080;
}

.post-content .quote:hover {
    text-decoration: underline;
}

/* Reply Form */
.reply-form-container {
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #cccccc;
}

.reply-form-container h3 {
    font-size: 14px;
    color: #000080;
    margin-bottom: 10px;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 20px;
    border: 2px solid #000080;
    width: 300px;
    max-width: 90%;
}

.close {
    color: #aaaaaa;
    float: right;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000000;
}

.kaomoji-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.kaomoji-grid button {
    font-family: "MS Gothic", "ＭＳ ゴシック", monospace;
    font-size: 12px;
    padding: 5px;
    background-color: #f0f0f0;
    border: 1px solid #cccccc;
    cursor: pointer;
}

.kaomoji-grid button:hover {
    background-color: #e0e0e0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 10px;
    border-top: 2px solid #000080;
    background-color: #f0f0f0;
}

.footer-info {
    margin-bottom: 10px;
}

.footer-link {
    color: #0000ff;
    text-decoration: none;
}

.footer-link:visited {
    color: #800080;
}

.footer-link:hover {
    text-decoration: underline;
}

.copyright {
    font-size: 11px;
    color: #666666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .form-label {
        width: 60px;
        font-size: 11px;
    }
    
    .form-table input[type="text"],
    .form-table textarea {
        width: 100%;
        max-width: 300px;
    }
    
    .thread-table {
        font-size: 11px;
    }
    
    .kaomoji-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Hidden admin link */
.admin-link {
    color: #f0f0f0 !important;
    cursor: pointer;
    font-size: 10px;
    padding: 0 2px;
    margin-left: 5px;
}

.admin-link:hover {
    color: #cccccc !important;
    text-decoration: none;
}

.admin-link.hidden {
    display: inline-block !important;
    opacity: 0.3;
}

.admin-link.hidden:hover {
    opacity: 0.7;
}

/* ASCII Art Styles */
.ascii-art {
    font-family: "MS Gothic", "ＭＳ ゴシック", monospace;
    font-size: 10px;
    line-height: 1.2;
    white-space: pre;
    background-color: #f0f0f0;
    padding: 10px;
    border: 1px solid #cccccc;
    margin: 5px 0;
    overflow-x: auto;
}

/* Status indicators */
.status-new {
    color: #ff0000;
    font-weight: bold;
}

.status-hot {
    color: #ff6600;
    font-weight: bold;
}

.status-normal {
    color: #000000;
}

/* Hidden elements */
.hidden {
    display: none;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 20px;
    color: #666666;
    font-size: 12px;
}

/* Error messages */
.error {
    color: #ff0000;
    background-color: #ffeeee;
    border: 1px solid #ff0000;
    padding: 10px;
    margin: 10px 0;
    font-size: 12px;
}

.success {
    color: #008000;
    background-color: #eeffee;
    border: 1px solid #008000;
    padding: 10px;
    margin: 10px 0;
    font-size: 12px;
}