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

html, body {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Layout components */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a73e8, #165cbd);
    padding: 1rem 2rem;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
    font-weight: 500;
}

main {
    flex: 1;
    min-height: 0;
    display: flex;
    background: #f8f9fa;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: white;
    min-height: 0;
}

.flex-row {
    flex: 1;
    display: flex;
    gap: 2rem;
    min-height: 0;
    overflow: hidden;
}

.column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    height: 100%;
}

/* Form elements */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    padding: 0.25rem 0;
}

select, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

select:disabled {
    opacity: 0.8;
    background-color: #f8f9fa;
    cursor: not-allowed;
}

textarea {
    font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
    line-height: 1.5;
    border: 1px solid #e0e0e0;
    height: 100%;
    min-height: 0;
    background: white;
}

.textarea-grow {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.textarea-grow textarea {
    flex: 1;
    resize: none;
    overflow-y: auto;
}

.input-direction {
    color: #1a73e8;
    font-size: 1.1rem;  /* Increased from 0.85rem */
    font-weight: 600;   /* Made bolder */
    margin: 0.25rem 0;  /* Adjusted spacing */
}

.input-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

/* Buttons */
.button-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#actionButton {
    background: #1a73e8;
    color: white;
}

button.secondary {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
}

button.secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e9ecef;
    pointer-events: none;
}

.swap-column {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
}

swap-button {
    background: #ffd43b;
    color: #212529;
    padding: 1rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-icon {
    font-size: 1.25rem;
    line-height: 1;
    display: block;
}

.swap-button {
    background: #ffd43b;
    color: #212529;
    padding: 1rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.swap-button:hover {
    background: #ffc107;
    transform: translateY(-1px);
}

/* Status elements */
.byte-size-info {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
}

.byte-size-info strong {
    font-weight: 600;
    margin: 0 0.15rem;
}

.output-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    animation: fadeIn 0.3s;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
footer {
    background: #f1f3f5;
    padding: 1rem;
    text-align: center;
    color: #495057;
    font-size: 0.9rem;
    border-top: 1px solid #dee2e6;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    body, .content { background: #121212; color: #e0e0e0; }
    header { background: linear-gradient(135deg, #333, #222); }
    select, textarea { background: #2d2d2d; border-color: #3d3d3d; color: #e0e0e0; }
    select:disabled { background-color: #1e1e1e; }
    button.secondary { background: #2d2d2d; border-color: #3d3d3d; color: #e0e0e0; }
    .byte-size-info { color: #69db7c; }
    button.secondary:disabled {
        background: #1e1e1e;
        opacity: 0.5;
    }
    .input-direction {
        color: #8ab4f8;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .content { padding: 1rem; }
    .flex-row { flex-direction: column; }
}

/* New section styles */
.section {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #f8f9fa;
}

.endpoint-panel, .doc-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.endpoint-panel select,
.endpoint-panel input {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1rem;
}

/* Optional: hover effect for documentation link */
.doc-panel a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.doc-panel a:hover {
    text-decoration: underline;
}
