/**
 * Major Tom - Pedalboard Commander
 * Feuille de style principale
 */

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Palette de couleurs */
    --color-space-black: #0A0A0A;
    --color-moon-white: #F1F1F1;
    --color-stellar-blue: #0077FF;
    --color-satellite-gray: #444444;
    --color-alarm-red: #FF4136;
    --color-control-green: #2ECC40;
    
    /* Dégradés */
    --gradient-space: linear-gradient(135deg, #0A0A0A 0%, #1A1A2E 100%);
    
    /* Ombres */
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(0, 119, 255, 0.5);
    
    /* Dimensions */
    --header-height: 70px;
    --nav-width: 220px;
}

html, body {
    height: 100%;
}

body {
    background: var(--gradient-space);
    color: var(--color-moon-white);
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
    color: var(--color-moon-white);
    margin-bottom: 1rem;
}

a {
    color: var(--color-stellar-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover, a:focus {
    color: var(--color-moon-white);
    text-shadow: 0 0 5px var(--color-stellar-blue);
}

/* =========================================
   HEADER
   ========================================= */
header {
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    margin-right: 1rem;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 0.7rem;
    margin-left: 0.5rem;
    color: var(--color-stellar-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================
   NAVIGATION
   ========================================= */
.main-nav {
    flex: 1;
    max-width: var(--nav-width);
}

.main-nav ul {
    display: flex;
    list-style: none;
    height: 100%;
}

.main-nav li {
    position: relative;
}

.main-nav li a {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: var(--header-height);
    color: var(--color-moon-white);
}

.main-nav li.active a, 
.main-nav li a:hover {
    background-color: rgba(0, 119, 255, 0.1);
    color: var(--color-stellar-blue);
}

.main-nav li.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--color-stellar-blue);
    box-shadow: 0 0 10px rgba(0, 119, 255, 0.8);
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    fill: currentColor;
}

.user-menu {
    display: flex;
    align-items: center;
}

.username {
    margin-right: 1rem;
    font-weight: bold;
    color: var(--color-stellar-blue);
}

.logout-btn {
    background-color: transparent;
    border: 1px solid var(--color-alarm-red);
    color: var(--color-alarm-red);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: var(--color-alarm-red);
    color: var(--color-moon-white);
}

/* =========================================
   MAIN CONTAINER
   ========================================= */
.container {
    padding: calc(var(--header-height) + 1rem) 1.5rem 1.5rem;
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   CARDS & SECTIONS
   ========================================= */
.card {
    background-color: rgba(20, 20, 30, 0.7);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-satellite-gray);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.2rem;
    margin: 0;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '//';
    color: var(--color-stellar-blue);
    margin-right: 0.5rem;
}

/* =========================================
   FORMULAIRES
   ========================================= */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--color-stellar-blue);
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--color-satellite-gray);
    border-radius: 4px;
    color: var(--color-moon-white);
    font-family: 'Space Mono', monospace;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--color-stellar-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.25);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.5rem;
}

.color-picker {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: none;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--color-stellar-blue);
    color: var(--color-moon-white);
}

.btn-primary:hover {
    background-color: #0066dd;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-danger {
    background-color: var(--color-alarm-red);
    color: var(--color-moon-white);
}

.btn-danger:hover {
    background-color: #e52d23;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 65, 54, 0.5);
}

.btn-secondary {
    background-color: var(--color-satellite-gray);
    color: var(--color-moon-white);
}

.btn-secondary:hover {
    background-color: #555555;
    transform: translateY(-2px);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

/* =========================================
   TABLEAUX
   ========================================= */
.table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-satellite-gray);
}

th {
    background-color: rgba(0, 0, 0, 0.2);
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    color: var(--color-stellar-blue);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

tr:hover {
    background-color: rgba(0, 119, 255, 0.05);
}

/* =========================================
   ALERTS & MESSAGES
   ========================================= */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    position: relative;
}

.alert-info {
    background-color: rgba(0, 119, 255, 0.1);
    border-left: 3px solid var(--color-stellar-blue);
}

.alert-success {
    background-color: rgba(46, 204, 64, 0.1);
    border-left: 3px solid var(--color-control-green);
}

.alert-danger {
    background-color: rgba(255, 65, 54, 0.1);
    border-left: 3px solid var(--color-alarm-red);
}

/* =========================================
   GRIDS ET LAYOUTS
   ========================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================
   PEDALES & PRESETS CARTES
   ========================================= */
.pedale-card {
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    border-top: 3px solid var(--color-stellar-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pedale-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.pedale-card .pedale-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pedale-card .pedale-img {
    width: 60px;
    height: 60px;
    margin-right: 1rem;
    object-fit: cover;
    border-radius: 4px;
}

.pedale-card .pedale-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    margin: 0;
}

.pedale-card .pedale-brand {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.pedale-card .pedale-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 119, 255, 0.2);
    border-radius: 4px;
    font-size: 0.7rem;
    margin-top: 0.5rem;
}

.pedale-card .pedale-loop {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.pedale-card .pedale-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

/* Preset cards */
.preset-card {
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid var(--color-stellar-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.preset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.preset-card .preset-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.preset-card .preset-bank {
    font-size: 0.8rem;
    color: var(--color-stellar-blue);
    margin-bottom: 0.5rem;
}

.preset-card .preset-pedals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.preset-card .pedal-pill {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 0.7rem;
}

.preset-card .preset-amp {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.preset-card .preset-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* =========================================
   SWITCHES
   ========================================= */
.switches-layout {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.switch {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background-color: var(--color-satellite-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.switch:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.switch-number {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--color-moon-white);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.switch-name {
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.switch-type {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.switch-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-control-green);
    margin-bottom: 0.5rem;
    box-shadow: 0 0 10px var(--color-control-green);
}

.switch-preset {
    background-color: var(--color-stellar-blue);
}

.switch-pedale {
    background-color: var(--color-control-green);
}

.switch-fonction {
    background-color: var(--color-satellite-gray);
}

/* =========================================
   ROUTING VISUALISATION
   ========================================= */
.routing-container {
    position: relative;
    padding: 2rem;
    background-color: rgba(10, 10, 10, 0.6);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.routing-item {
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    border-left: 3px solid var(--color-stellar-blue);
    display: flex;
    align-items: center;
}

.routing-arrow {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid rgba(0, 119, 255, 0.3);
}

.routing-name {
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    font-size: 1rem;
}

.routing-type {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* =========================================
   MEDIA QUERIES
   ========================================= */
@media (max-width: 768px) {
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav li a span {
        display: none;
    }
    
    .main-nav li a {
        padding: 0 0.75rem;
    }
    
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .switches-layout {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1rem;
    }
    
    .switches-layout {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}
