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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 20px 0;
}

h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

h2 {
    color: #444;
    font-size: 1.5em;
    margin-bottom: 20px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.converter-section {
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 1.1em;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input.error {
    border-color: #e74c3c;
    background-color: #ffe6e6;
}

.error-text {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 4px;
    min-height: 1.2em;
}

.data-types-section {
    margin-top: 40px;
}

.info-text {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.type-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s;
}

.type-btn:hover {
    background: #f0f3ff;
}

.type-btn.active {
    background: #667eea;
    color: white;
}

#typeResults {
    display: grid;
    gap: 20px;
}

.type-result {
    background: #f8f9ff;
    border: 2px solid #e0e4ff;
    border-radius: 8px;
    padding: 20px;
}

.type-result h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.value-row {
    margin-bottom: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.value-row strong {
    display: inline-block;
    min-width: 120px;
    color: #555;
}

.value-row code {
    font-family: 'Courier New', monospace;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    color: #333;
}

.bytes-display {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.bytes-display h4 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1em;
}

.endian-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.endian-label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.endian-panel {
    background: #f8f9ff;
    border: 1px solid #e0e4ff;
    border-radius: 6px;
    padding: 12px;
}

.endian-panel-header {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1em;
}

.endian-panel-value {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.endian-panel-value div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.endian-panel-value strong {
    min-width: 80px;
    color: #555;
}

.byte-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.byte-label {
    min-width: 140px;
    font-weight: 600;
    color: #666;
}

.byte-box {
    display: inline-block;
    padding: 6px 10px;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    min-width: 45px;
    text-align: center;
}

.chunks-container {
    margin-top: 15px;
}

.chunk {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.chunk-header {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.chunk-values {
    display: grid;
    gap: 8px;
}

.chunk-values div {
    padding: 8px;
    background: #f8f9ff;
    border-radius: 4px;
}

.error-message {
    color: #e74c3c;
    background: #ffe6e6;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #e74c3c;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .type-selector {
        justify-content: center;
    }
    
    .type-btn {
        flex: 1 1 calc(50% - 10px);
        min-width: 120px;
    }
}

.string-conversion-section {
    margin-top: 40px;
}

.conversion-box {
    background: #f8f9ff;
    border: 2px solid #e0e4ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.conversion-box h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.1em;
}

#asciiOutput,
#midiOutput {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    resize: vertical;
    background: white;
    color: #333;
}

.info-small {
    font-size: 0.85em;
    color: #999;
    margin: 8px 0;
}

.copy-btn-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.copy-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}
