/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #0a0e17;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #050811;
    z-index: 0;
}

/* Header Styles */
#header {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    background: rgba(10, 20, 40, 0.92);
    color: white;
    padding: 1em 1.5em;
    border-radius: 12px;
    z-index: 1001;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6);
    transition: all 0.4s ease;
    border: 1px solid rgba(100, 150, 255, 0.2);
}

#header p {
    font-size: 0.85em;
    margin-top: 0.25em;
    line-height: 1.4;
    color: #a0c0ff;
}

#close-header {
    position: absolute;
    top: 0.5em;
    right: 0.7em;
    background: none;
    border: none;
    color: #a0c0ff;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-header:hover {
    transform: rotate(90deg);
    background: rgba(100, 150, 255, 0.2);
}

/* Status Styles */
#status {
    position: fixed;
    bottom: 5.5em;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 40, 0.9);
    padding: 0.7em 1.8em;
    border-radius: 8px;
    font-size: 0.9em;
    z-index: 1000;
    max-width: 90vw;
    text-align: center;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(100, 150, 255, 0.2);
    color: #c0d5ff;
}

/* Collapsible Controls */
#controls-container {
    position: fixed;
    top: 1.5em;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

#controls-toggle {
    background: rgba(10, 20, 40, 0.92);
    color: #a0c0ff;
    border: 1px solid rgba(100, 150, 255, 0.2);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3em;
    margin-bottom: 5px;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

#controls-toggle:hover {
    background: rgba(20, 40, 80, 0.95);
    transform: scale(1.1);
    color: white;
}

#controls {
    display: flex;
    gap: 0.8em;
    align-items: center;
    background: rgba(10, 20, 40, 0.92);
    padding: 1em 1.8em;
    border-radius: 14px;
    z-index: 1000;
    flex-wrap: wrap;
    max-width: 95vw;
    justify-content: center;
    transition: all 0.4s ease;
    transform-origin: top center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(100, 150, 255, 0.2);
}

#controls.collapsed {
    transform: scaleY(0);
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: -20px;
    pointer-events: none;
}

/* API Key Container */
.api-key-container {
    position: relative;
    width: 300px;
    max-width: 60vw;
}

#api-key {
    width: 100%;
    padding: 0.7em 2.5em 0.7em 1em;
    font-size: 0.9em;
    background: rgba(5, 15, 30, 0.8);
    color: #c0d5ff;
    border: 1px solid rgba(100, 150, 255, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

#api-key:focus {
    border-color: #4a8cff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 140, 255, 0.3);
}        

#selector, #platesolve-btn {
    padding: 0.7em 1.2em;
    font-size: 0.9em;
    width: auto;
    background: rgba(20, 40, 80, 0.7);
    color: white;
    border: 1px solid rgba(100, 150, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#selector {
    min-width: 180px;
    background: rgba(15, 30, 60, 0.8);
}

#selector:hover {
    background: rgba(30, 60, 120, 0.8);
    border-color: rgba(120, 170, 255, 0.4);
}

#platesolve-btn {
    background: linear-gradient(to right, #1a2a6c, #2a3a9c);
    border: 1px solid rgba(120, 170, 255, 0.4);
    font-weight: 600;
    min-width: 180px;
}

#platesolve-btn:hover {
    background: linear-gradient(to right, #2a3a9c, #3a4abc);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Results Panel */
#results {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 20, 40, 0.95);
    color: white;
    padding: 1.8em;
    border-radius: 14px;
    z-index: 1002;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: auto;
    display: none;
    border: 1px solid rgba(100, 150, 255, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

#results-content {
    color: #c0d5ff;
    background: rgba(5, 15, 30, 0.7);
    padding: 1.5em;
    border-radius: 8px;
    border: 1px solid rgba(100, 150, 255, 0.2);
    overflow: auto;
    max-height: 50vh;
    font-size: 0.9em;
    line-height: 1.5;
}

#results h3 {
    margin-top: 0;
    color: #4a8cff;
    padding-bottom: 0.5em;
    border-bottom: 1px solid rgba(100, 150, 255, 0.2);
    margin-bottom: 1em;
}

#close-results {
    position: absolute;
    top: 0.7em;
    right: 0.7em;
    background: none;
    border: none;
    color: #a0c0ff;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

#close-results:hover {
    color: white;
    transform: scale(1.1);
}

.result-item {
    margin-bottom: 1em;
    padding-bottom: 1em;
    border-bottom: 1px dashed rgba(100, 150, 255, 0.2);
}

.result-label {
    font-weight: 600;
    color: #4a8cff;
    margin-right: 0.5em;
}

.result-value {
    word-break: break-all;
}

.result-link {
    color: #6ac;
    text-decoration: none;
    transition: all 0.3s ease;
}

.result-link:hover {
    color: #8cf;
    text-decoration: underline;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(160, 192, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4a8cff;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Star background */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* Nebula effect */
.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(41, 82, 163, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 70% 60%, rgba(138, 43, 226, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 40% 80%, rgba(220, 20, 60, 0.15) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* API Key Status */
.api-status {
    font-size: 0.8em;
    margin-top: 0.3em;
    color: #6ac;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.api-status.show {
    opacity: 1;
}
