/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    background-color: #e8f4fd;
    overflow: hidden;
}

/* Blue Title Bar */
.title-bar {
    background: linear-gradient(180deg, #4a90e2 0%, #2c5aa0 100%);
    height: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    border-bottom: 1px solid #1e3a5f;
    color: white;
}

.title-text {
    font-weight: bold;
    font-size: 13px;
}

.title-close {
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

.title-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Application Container */
.app-container {
    display: flex;
    height: calc(100vh - 24px);
}

/* Left Sidebar */
.sidebar {
    width: 220px;
    background-color: #d1e7ff;
    border-right: 1px solid #a0c8e8;
    overflow-y: auto;
}

.category-list {
    padding: 0;
}

.category-item {
    padding: 4px 8px;
    background-color: #d1e7ff;
    border: 1px solid #a0c8e8;
    border-bottom: none;
    cursor: pointer;
    font-size: 13px;
    color: #2c5aa0;
    user-select: none;
    transition: background-color 0.1s ease;
}

.category-item:first-child {
    border-top: 1px solid #a0c8e8;
}

.category-item:last-child {
    border-bottom: 1px solid #a0c8e8;
}

.category-item:hover {
    background-color: #b8d9ff;
}

.category-item.active {
    background-color: #ff6b6b;
    color: white;
}

.category-item.active:hover {
    background-color: #ff5252;
}

/* Right Conversion Area */
.conversion-area {
    flex: 1;
    padding: 16px;
    background-color: #f8fcff;
    overflow-y: auto;
}

#conversionTitle {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #2c5aa0;
}

/* Conversion Form */
.conversion-form {
    max-width: 400px;
}

.conversion-row {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Swap Button */
.swap-container {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.swap-button {
    background: linear-gradient(180deg, #f8fcff 0%, #e8f4fd 100%);
    border: 2px outset #a0c8e8;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    color: #2c5aa0;
    transition: all 0.1s ease;
    font-family: inherit;
    min-width: 40px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-button:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f0f8ff 100%);
    border-color: #ff6b6b;
}

.swap-button:active {
    border: 2px inset #a0c8e8;
    background: linear-gradient(180deg, #e8f4fd 0%, #d1e7ff 100%);
}

.swap-arrow {
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.conversion-row label {
    font-size: 13px;
    font-weight: bold;
    color: #2c5aa0;
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-row input {
    flex: 1;
    padding: 4px 6px;
    border: 2px inset #a0c8e8;
    background-color: white;
    font-size: 13px;
    font-family: inherit;
    min-width: 100px;
}

.input-row input:focus {
    outline: 1px dotted #ff6b6b;
    outline-offset: -2px;
}

.input-row input[readonly] {
    background-color: #f8fcff;
    color: #666;
}

.input-row select {
    padding: 3px 4px;
    border: 2px inset #a0c8e8;
    background-color: white;
    font-size: 13px;
    font-family: inherit;
    min-width: 120px;
}

.input-row select:focus {
    outline: 1px dotted #ff6b6b;
    outline-offset: -2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 180px;
    }
    
    .conversion-area {
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #d3d3d3;
    }
    
    .conversion-area {
        height: calc(100vh - 224px);
    }
}