/* styles.css - Glassmorphism Theme - Mobile Optimized */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
    --text-color: #EAEAEA;
    --text-color-dark: #B0B0B0;
    --background-start: #1a1a2e;
    --background-end: #16213e;
    --panel-bg: rgba(255, 255, 255, 0.08);
    --panel-border: rgba(255, 255, 255, 0.2);
    --blur: 15px;
    --glow-start: #48a6b5;
    --glow-end: #0f3460;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --error-color: #e74c3c;
}

/* Universal Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: black;    
    color: var(--text-color);
    margin: 0;
    padding: 1rem;
    overflow-x: hidden; /* Prevents horizontal scroll */
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

header {
    text-align: center;
    padding: 0.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 70px;
    height: auto;
    border-radius: 12px;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
}
header p {
    display: none;
}

.main-content-wrapper {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    padding: 1rem;
}

.left-panel { flex: 3; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.right-panel { flex: 2; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.canvas-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.canvas-container.focus-control-active {
    cursor: crosshair;
}
.canvas-container.guide-control-active {
    cursor: default;
}


#canvas, #guide-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    pointer-events: none;
}

#canvas-prompt {
    position: absolute;
    z-index: 5;
}

.focus-point {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(79, 172, 254, 0.8);
    border: 2px solid var(--text-color);
    box-shadow: 0 0 12px rgba(79, 172, 254, 0.7);
    transform: translate(-50%, -50%);
    display: none;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.focus-point.active-control {
    box-shadow: 0 0 20px 5px var(--glow-start);
}

.guide-controls {
    position: absolute;
    display: none;
    pointer-events: all;
    background: rgba(79, 172, 254, 0.0);
    z-index: 100;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    transition: background-color 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.guide-controls.active-control {
    cursor: grab;
    border: 2px solid var(--glow-start);
    box-shadow: 0 0 15px var(--glow-start);
}
.guide-controls.active-control:active {
    cursor: grabbing;
}

.guide-resizer {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: var(--glow-start);
    border-radius: 50%;
    cursor: nwse-resize;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--background-end);
}
.guide-resizer svg {
    width: 16px;
    height: 16px;
}
.guide-resizer:hover {
    transform: scale(1.1);
}

.adherence-container { display: flex; flex-direction: column; gap: 0.5rem; }
.adherence-bar { width: 100%; height: 10px; background: rgba(0, 0, 0, 0.3); border-radius: 5px; overflow: hidden; }
#adherence-fill { height: 100%; width: 0%; background-color: var(--error-color); transition: width 0.5s ease, background-color 0.5s ease; border-radius: 5px; }
#composition-score { width: 100%; display: flex; justify-content: space-between; align-items: center; }
#adherence-text { font-size: 0.85rem; color: var(--text-color-dark); }
#adherence-percent { font-size: 0.9rem; font-weight: 700; }

.control-section { display: flex; flex-direction: column; gap: 0.75rem; }
.control-section h2 { margin: 0; font-size: 1.1rem; border-bottom: 1px solid var(--panel-border); padding-bottom: 0.5rem; }

.button-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nav-btn, .composition-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    flex-grow: 1;
    flex-basis: 80px;
    text-align: center;
}
.nav-btn:hover, .composition-btn:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.composition-btn.active, .nav-btn.active { background: var(--glow-start); color: #1a1a2e; font-weight: 700; }

.composition-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.5rem; }

.control-group { display: flex; flex-direction: column; gap: 0.25rem; }
.control-group label { color: var(--text-color-dark); font-size: 0.8rem; }
select { background: rgba(0, 0, 0, 0.3); color: var(--text-color); border: 1px solid var(--panel-border); padding: 0.4rem; border-radius: 6px; font-size: 0.8rem;}
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; background: rgba(0, 0, 0, 0.3); border-radius: 2px; width: 100%; }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--glow-start);
    border-radius: 50%;
    cursor: pointer;
}

/* =================================== */
/* == Responsive Styles for Tablets == */
/* =================================== */
@media (max-width: 900px) {
    .main-content-wrapper { 
        flex-direction: column; 
        gap: 1rem; 
    }
    
    .left-panel, .right-panel { 
        flex: 1 1 100%; /* Allow panels to take full width */
    }

    .canvas-container { 
        min-height: 45vh; 
        aspect-ratio: unset; /* Allow flexible height */
    }
}

/* ================================= */
/* == Responsive Styles for Mobile == */
/* ================================= */
@media (max-width: 600px) {
    body { 
        padding: 0.5rem; 
    }

    .container { 
        gap: 1rem; 
    }

    /* Stack logo and title vertically */
    header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .header-text-container {
        align-items: center; /* Center the title image and text */
    }

    .logo {
        width: 60px;
    }

    .header-title-img {
        height: 40px;
    }

    #guide-description-header {
        font-size: 0.9rem;
        text-align: center;
    }

    .panel { 
        padding: 0.75rem; 
    }

    .nav-btn, .composition-btn {
        padding: 0.6rem 0.5rem;
        font-size: 0.75rem;
    }

    .composition-buttons { 
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); 
    }
}
