/* Mobile-First Responsive CSS for Waffle.cat */

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

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
    padding: 10px;
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ASCII Header */
.ascii-header {
    border: 2px solid #000000;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #ffffff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ascii-logo {
    font-size: 7px;
    line-height: 1.1;
    white-space: pre;
    font-weight: bold;
}

.tagline {
    margin-top: 10px;
    padding-left: 5px;
    border-left: 3px solid #000000;
    font-size: 11px;
}

/* Navigation */
.nav {
    border: 2px solid #000000;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #f5f5f5;
}

.nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav a {
    display: block;
    color: #000000;
    text-decoration: none;
    padding: 12px;
    border: 1px solid #000000;
    background-color: #ffffff;
    transition: all 0.2s;
    text-align: center;
    font-size: 12px;
}

.nav a:active {
    background-color: #000000;
    color: #ffffff;
}

/* Test Sections */
.test-section {
    border: 2px solid #000000;
    padding: 12px;
    margin-bottom: 15px;
    background-color: #ffffff;
}

.test-section h2 {
    border-bottom: 2px solid #000000;
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-size: 15px;
    word-wrap: break-word;
}

.test-section h2::before {
    content: "[+] ";
}

.test-section h3 {
    font-size: 13px;
    margin: 10px 0 5px 0;
}

.test-result {
    background-color: #f5f5f5;
    border: 1px solid #000000;
    padding: 10px;
    margin: 10px 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.test-result pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Info Rows */
.info-row {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px dotted #000000;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 12px;
}

.info-label::after {
    content: ":";
}

.info-value {
    word-break: break-word;
    font-size: 11px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 10px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table th,
table td {
    border: 1px solid #000000;
    padding: 6px 4px;
    text-align: left;
}

table th {
    background-color: #000000;
    color: #ffffff;
    font-weight: bold;
}

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

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 14px;
    margin: 6px 0;
    border: 2px solid #000000;
    background-color: #ffffff;
    color: #000000;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    transition: all 0.2s;
    text-align: center;
    font-size: 13px;
    min-height: 44px;
}

.btn:active {
    background-color: #000000;
    color: #ffffff;
}

.btn:disabled {
    opacity: 0.5;
}

/* Canvas */
.canvas-container {
    border: 1px solid #000000;
    padding: 8px;
    margin: 10px 0;
    background-color: #f5f5f5;
    overflow-x: auto;
}

canvas {
    border: 1px dashed #000000;
    background-color: #ffffff;
    max-width: 100%;
    height: auto;
}

/* Footer */
.footer {
    border-top: 2px solid #000000;
    padding: 12px;
    margin-top: 15px;
    text-align: center;
    font-size: 10px;
}

.footer p {
    margin: 3px 0;
}

/* Loading */
.loading {
    display: inline-block;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Alert boxes */
.alert {
    border: 2px solid #000000;
    padding: 10px;
    margin: 8px 0;
    font-size: 12px;
    word-wrap: break-word;
}

.alert-warning {
    background-color: #ffff99;
}

.alert-info {
    background-color: #ccffff;
}

.alert-success {
    background-color: #ccffcc;
}

/* Code blocks */
code {
    background-color: #f5f5f5;
    border: 1px solid #000000;
    padding: 2px 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    word-wrap: break-word;
}

.code-block {
    background-color: #000000;
    color: #00ff00;
    border: 2px solid #000000;
    padding: 10px;
    margin: 8px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 10px;
}

/* Lists */
ul, ol {
    margin-left: 15px;
    margin-top: 5px;
}

li {
    margin-bottom: 4px;
    font-size: 12px;
}

/* TABLET: 600px+ */
@media (min-width: 600px) {
    body {
        padding: 15px;
        font-size: 15px;
    }
    
    .ascii-logo {
        font-size: 9px;
    }
    
    .tagline {
        font-size: 13px;
    }
    
    .nav {
        padding: 15px;
    }
    
    .nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav a {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .test-section {
        padding: 15px;
    }
    
    .test-section h2 {
        font-size: 17px;
    }
    
    .test-result {
        font-size: 12px;
        padding: 12px;
    }
    
    .info-row {
        flex-direction: row;
    }
    
    .info-label {
        min-width: 180px;
        margin-bottom: 0;
        font-size: 13px;
    }
    
    .info-value {
        flex: 1;
        font-size: 12px;
    }
    
    table {
        font-size: 11px;
    }
    
    .btn {
        width: auto;
        min-width: 140px;
        padding: 12px 18px;
    }
    
    .footer {
        font-size: 11px;
    }
}

/* DESKTOP: 1024px+ */
@media (min-width: 1024px) {
    body {
        padding: 20px;
        font-size: 16px;
    }
    
    .ascii-logo {
        font-size: 12px;
        line-height: 1.2;
    }
    
    .tagline {
        font-size: 14px;
    }
    
    .nav ul {
        gap: 15px;
    }
    
    .nav a {
        font-size: 14px;
        padding: 8px 14px;
    }
    
    .nav a:hover {
        background-color: #000000;
        color: #ffffff;
    }
    
    .test-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .test-section h2 {
        font-size: 20px;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    .test-result {
        padding: 15px;
        font-size: 14px;
    }
    
    .info-label {
        min-width: 200px;
        font-size: 15px;
    }
    
    .info-value {
        font-size: 14px;
    }
    
    table {
        font-size: 13px;
        display: table;
    }
    
    table th,
    table td {
        padding: 10px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .btn:hover {
        background-color: #000000;
        color: #ffffff;
    }
    
    .alert {
        font-size: 14px;
        padding: 15px;
    }
    
    code {
        font-size: 12px;
    }
    
    .code-block {
        font-size: 12px;
        padding: 15px;
    }
    
    li {
        font-size: 14px;
    }
    
    .footer {
        padding: 20px;
        font-size: 13px;
    }
}

/* Landscape mode */
@media (max-width: 1023px) and (orientation: landscape) {
    .ascii-logo {
        font-size: 6px;
    }
    
    .test-section {
        padding: 8px;
    }
    
    .test-section h2 {
        font-size: 13px;
    }
}

/* Print */
@media print {
    body {
        padding: 0;
    }
    
    .nav, .btn, .footer {
        display: none;
    }
    
    .test-section {
        page-break-inside: avoid;
    }
}
