/* apps/studio/static/studio/css/style.css */

:root {
    /* Brand Colors matching legacy dashboard */
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-color: #f4f7f6;
    --text-color: #333;
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
}

/* Global Reset & Typography */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* --------------------------------------
   Layout overrides for base.html 
   (Enhances the inline styles you wrote)
-------------------------------------- */
aside {
    background-color: var(--sidebar-bg);
    color: white;
    border-right: none !important;
    width: 250px;           /* Locks the sidebar width */
    height: 100vh;
    position: fixed;        /* Pins it to the left side */
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    padding: 15px 10px;
    box-sizing: border-box;
}

main {
    background-color: var(--bg-color);
    overflow-y: auto;
    height: 100vh;
    box-sizing: border-box;
    margin-left: 250px;     /* Pushes content to the right of the sidebar */
    width: calc(100% - 250px);
    padding: 20px;
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* --------------------------------------
   Mobile Responsive Sidebar Styles
-------------------------------------- */
@media (max-width: 768px) {
    aside {
        transform: translateX(-100%); /* Hides sidebar off-screen by default on mobile */
    }
    
    aside.mobile-open {
        transform: translateX(0); /* Slides sidebar in when active */
    }

    main {
        margin-left: 0; /* Content takes full width on mobile */
        width: 100%;
        padding-top: 70px; /* Makes room for the hamburger button */
    }
}

/* Hamburger Menu Button */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background 0.2s ease;
}

.mobile-nav-toggle:hover {
    background: var(--accent-color);
}

/* Dark Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .mobile-nav-toggle { display: block; } /* Shows hamburger only on mobile */
    .sidebar-overlay.active { display: block; }
}
/* --------------------------------------
   Sidebar Styling (partials/sidebar.html)
-------------------------------------- */
aside h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

aside ul {
    margin: 0;
    padding: 0;
}

aside ul li {
    margin-bottom: 5px;
}

aside ul li a {
    display: block;
    color: #bdc3c7;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

aside ul li a:hover, 
aside ul li a.active {
    background: var(--sidebar-hover);
    color: white;
    border-left: 4px solid var(--accent-color);
    padding-left: 16px; /* Offset the border width to keep text aligned */
}

/* --------------------------------------
   UI Components (Cards, Buttons, Inputs)
-------------------------------------- */
h1, h2, h3 {
    color: var(--primary-color);
}

/* Card Container */
.card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 24px;
    box-sizing: border-box;
}

/* Grid for Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-container .card {
    text-align: center;
    padding: 20px;
}

.stats-container .card h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 2.2rem;
}

.stats-container .card p {
    color: #718096;
    margin-top: 8px;
    margin-bottom: 0;
    font-weight: 500;
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219653;
}

/* Alerts */
.alert {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 500;
}

.alert-success {
    background: #e6fffa;
    color: #22543d;
    border: 1px solid #b2f5ea;
}

.alert-error, .alert-danger {
    background: #fdeaea;
    color: #c53030;
    border: 1px solid #feb2b2;
}

/* Utility classes */
.text-muted {
    color: #718096;
}

/* --------------------------------------
   Dropdown Sidebar Styles
-------------------------------------- */
.dropdown-btn {
    display: block;
    width: 100%;
    color: #bdc3c7;
    padding: 12px 20px;
    text-decoration: none;
    font-size: 1rem;
    background-color: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    border-radius: 6px;
    margin-bottom: 5px;
    margin-top: 5px;
}

.dropdown-btn:hover, 
.dropdown-btn.active {
    background-color: var(--sidebar-hover);
    color: white;
    border-left: 4px solid var(--accent-color);
    padding-left: 16px;
    border-radius: 0 6px 6px 0;
}

.dropdown-container {
    background-color: rgba(0, 0, 0, 0.15); /* Slightly darker nested background */
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}

/* Indent the links inside the dropdown */
.dropdown-container ul li a {
    padding-left: 40px; 
    font-size: 0.95rem;
}

/* Arrow rotation */
.arrow {
    float: right;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown-btn.active .arrow {
    transform: rotate(180deg);
}