/* Find Bounding Box 3D - CSS avec couleurs PSSN Solutions */

:root {
    --primary-color: #4389aa;      /* Bleu PSSN Solutions */
    --primary-dark: #2d6583;       /* Bleu plus foncé pour les dégradés */
    --secondary-color: #ef972c;    /* Orange PSSN Solutions */
    --success-color: #4CAF50;
    --error-color: #f44336;
    --warning-color: #ef972c;      /* Orange PSSN pour les warnings */
    --info-color: #4389aa;         /* Bleu PSSN pour les infos */
    --bg-color: #f5f7fa;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.logout-btn {
    float: right;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.panel {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 16px;
}

h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
}

input[type="number"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Onglets */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 20px;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Box inputs */
.box-input {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.quantity-rotation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Boutons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 137, 170, 0.4);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    margin-top: 10px;
}

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

/* Résultats */
#results {
    display: none;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
}

.stat-label {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-value {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;  /* Empêche le retour à la ligne */
}

.download-section {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

#plot {
    width: 100%;
    height: 600px;
    border-radius: 5px;
    margin-top: 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    display: none;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid var(--info-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.info-box ul {
    margin-left: 20px;
    color: #555;
}

/* Template */
.template-info {
    padding: 20px;
}

.template-buttons {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.template-example {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.template-example table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.template-example th,
.template-example td {
    padding: 10px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.template-example th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.template-example td {
    background: white;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dimensions-grid {
        grid-template-columns: 1fr;
    }
    
    .quantity-rotation {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}
