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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif, Ubuntu;
    background: linear-gradient(145deg, #f0f4f8 0%, #e6ecf3 100%);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #1a2634;
}

.app-header {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 20, 40, 0.08);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e2b3a, #2c3e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin: 0;
    text-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.control-panel {
    background: rgba(20, 30, 40, 0.65);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    min-width: 360px;
    box-shadow: 0 18px 35px -12px rgba(0, 20, 40, 0.25), 0 6px 12px -6px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    overflow: hidden;
}

.control-panel:hover {
    box-shadow: 0 22px 40px -15px rgba(0, 30, 60, 0.4);
    background: rgba(25, 35, 45, 0.7);
    border-color: rgba(255, 255, 255, 0.35);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px 20px 0 0;
    cursor: pointer;
    transition: background 0.2s;
}

.panel-header:hover {
    background: rgba(255, 255, 255, 0.15);
}

.panel-title {
    font-weight: 600;
    color: #ffffff;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.collapse-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 40px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.collapse-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.panel-body {
    padding: 1.5rem;
    transition: all 0.3s ease;
    color: #f0f4fa;
}

.panel-body.collapsed {
    display: none;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    backdrop-filter: blur(4px);
    transition: border 0.2s, background 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
}

.course-select option {
    background: #1e2b3a;
    color: white;
}

.course-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.course-select:focus {
    outline: none;
    border-color: #5f9eff;
    background: rgba(255, 255, 255, 0.2);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.btn {
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: #2563eb;
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.theme-section {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1.25rem;
    margin-top: 0.75rem;
}

.theme-section h4 {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.color-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-family: 'Fira Code', monospace;
    backdrop-filter: blur(4px);
}

.color-input:focus {
    outline: none;
    border-color: #5f9eff;
}

.theme-presets {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.preset-btn {
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.preset-btn:hover {
    transform: scale(1.1) translateY(-2px);
    border-color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
}

.preset-btn:active {
    transform: scale(0.95);
}

.status {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    min-height: 1.5rem;
    padding: 0.5rem 0;
    margin-top: 0.75rem;
    border-top: 1px dashed rgba(255,255,255,0.2);
}

.viewer-container {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
}
