/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    background: #000;
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 35%),
        radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 35%),
        radial-gradient(circle at 75% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 25% 75%, rgba(255, 255, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(50, 50, 50, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%),
        linear-gradient(45deg, #000000 0%, #1a1a1a 100%);
    background-attachment: fixed;
    background-size: 100% 100%, 100% 100%, 50% 50%, 50% 50%, 100% 100%, 100% 100%;
    min-height: 100vh;
    color: #e5e5e5;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Hero */
.hero {
    margin: 48px 0;
    padding: 32px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-inner {
    display: flex;
    align-items: flex-start;
    align-items: center;
}

.hero-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.logo-highlight {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.1em;
}

.hero-content {
    flex: 1;
    padding-top: 8px;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    display: flex;
    justify-content: center;
}

.app-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.hero-meta {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.5;
}

/* Panel with hanger */
.cm-panel {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    padding-top: 24px;
}

.cm-panel:before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.2));
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}

.cm-panel:after {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}

/* Glass Card */
.cm-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 32px;
    margin: 24px;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.05),
        0 10px 15px rgba(0,0,0,0.1),
        0 20px 30px rgba(0,0,0,0.15);
}

.cm-card-title {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cm-card-title .material-icons {
    margin-right: 8px;
    font-size: 18px;
}

.cm-subtitle {
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(0,0,0,0.5);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cm-divider {
    height: 1px;
    background: rgba(0,0,0,0.08);
    margin: 32px 0;
}

/* Inputs & Selects - Unified */
.cm-card input[type="text"],
.cm-card input[type="number"],
.cm-card select {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: rgba(0,0,0,0.8);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s;
    margin-bottom: 20px;
    -webkit-appearance: none;
    appearance: none;
}

.cm-card select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.cm-card input[type="text"]:focus,
.cm-card input[type="number"]:focus,
.cm-card select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.98);
}

/* Score Display */
.score-wrapper {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: white;
    overflow: hidden;
}

.score-header {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.score-content {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

#score_container {
    background: white;
    color: black;
}

#score_container svg {
    max-width: 100%;
    height: auto;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Select Dropdown */
select::-ms-expand {
    display: none;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000000'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px !important;
    -webkit-appearance: none;
    appearance: none;
}

select option {
    background: white;
    color: rgba(0,0,0,0.8);
    padding: 12px 16px;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

select option:hover {
    background: rgba(0,0,0,0.04);
}

.cm-card input[type="text"]::placeholder {
    color: rgba(0,0,0,0.3);
}

.cm-card input[type="number"] {
    width: 80px;
}

/* Labels */
.cm-card label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(0,0,0,0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toggle Switch */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.toggle-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(0,0,0,0.7);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.15);
    transition: 0.25s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
    background: #ffffff;
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
    background: #000000;
}

/* Checkbox */
.cm-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid rgba(255,255,255,0.3);
    background: transparent;
    cursor: pointer;
}

.cm-card input[type="checkbox"]:checked {
    background: #ffffff;
    border-color: #ffffff;
}

/* Grid */
.cm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .cm-grid {
        grid-template-columns: 1fr;
    }
}

/* File Upload */
.cm-card .flex {
    display: flex;
}

.cm-card .flex.items-center {
    align-items: center;
}

.cm-card .flex.gap-3 {
    gap: 12px;
}

.cm-card label.cursor-pointer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    color: #1a1a1a;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cm-card label.cursor-pointer:hover {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.2);
}

.cm-card .flex-1 {
    flex: 1;
}

/* Help Text */
.cm-help {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.4);
}

.cm-help a {
    color: rgba(255,255,255,0.7);
    text-decoration: underline;
    transition: color 0.2s;
}

.cm-help a:hover {
    color: #ffffff;
}

/* Message */
#msg {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
}

/* CTA Row */
.cta-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Sun Blur Animation */
@keyframes sun-pulse {
    0% { box-shadow: 0 0 15px rgba(255,255,255,0.1); }
    50% { box-shadow: 0 0 25px rgba(255,255,255,0.2); }
    100% { box-shadow: 0 0 15px rgba(255,255,255,0.1); }
}

/* Primary Button */
.harmonise-btn {
    position: relative;
    overflow: hidden;
}

.harmonise-btn:disabled {
    animation: sun-pulse 2s ease-in-out infinite;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.harmonise-btn:disabled::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 50%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.harmonise-btn:not(:disabled):hover {
    background: black;
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.harmonise-btn:not(:disabled):hover i {
    color: white;
}

button#harmonise .material-icons {
    margin-left: 8px;
    font-size: 20px;
}

/* Utility */
.hidden { display: none; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.max-w-2xl { max-width: 42rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.md\:col-span-2 { grid-column: span 2; }

@media (max-width: 768px) {
    .md\:col-span-2 { grid-column: span 1; }
}
