/* ============================================
   APITRACK - STYLESHEET
   ============================================ */

:root {
    --primary: #f4a259;
    --primary-dark: #e8923f;
    --secondary: #5b8930;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --border: #ddd;
    --shadow: rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: #f8f9fa;
}

/* HEADER & NAVIGATION */
header {
    background: white;
    box-shadow: 0 2px 4px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

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

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary);
}

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

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

main.container {
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
}

/* HERO SECTION */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero .lead {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* FEATURES */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: #4a7228;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-logout {
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
}

/* AUTH FORMS */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    width: 100%;
    max-width: 500px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ALERTS */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fee;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-success {
    background: #efe;
    color: var(--success);
    border: 1px solid var(--success);
}

.alert ul {
    margin-left: 1.5rem;
}

/* DASHBOARD */
.dashboard h1 {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    margin: 2rem 0;
}

.quick-actions h2 {
    margin-bottom: 1.5rem;
}

.quick-actions .btn {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

.recent-activity {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

/* UTILITIES */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.mt-3 {
    margin-top: 1.5rem;
}

/* FOOTER */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .lead {
        font-size: 1.1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* PROFIL */
.profil-container {
    max-width: 1000px;
    margin: 0 auto;
}

.profil-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.profil-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.profil-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    border-bottom: 2px solid var(--light);
    padding-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .profil-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   RUCHERS
   ============================================ */

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb {
    display: inline-block;
    color: #666;
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb:hover {
    color: var(--primary);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.empty-state h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.empty-state-small {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Grille de ruchers */
.ruchers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.rucher-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.rucher-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px var(--shadow);
}

.rucher-card.rucher-shared {
    border-left: 4px solid var(--secondary);
}

.rucher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.rucher-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--dark);
}

.rucher-info {
    margin: 1rem 0;
}

.rucher-info p {
    margin: 0.5rem 0;
    color: #666;
}

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

/* Badges */
.badge-owner,
.badge-lecteur,
.badge-editeur,
.badge-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-owner {
    background: var(--primary);
    color: white;
}

.badge-lecteur {
    background: #6c757d;
    color: white;
}

.badge-editeur {
    background: var(--secondary);
    color: white;
}

.badge-status {
    font-size: 0.7rem;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

.badge-morte,
.badge-vendue {
    background: #d6d6d6;
    color: #333;
}

/* Formulaire de rucher */
.rucher-form-container {
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 2rem;
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 2px solid var(--light);
    padding-bottom: 0.5rem;
}

.help-text {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.coordinates-info {
    background: #e8f5e9;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

/* Détail du rucher */
.rucher-detail {
    max-width: 1200px;
    margin: 0 auto;
}

.rucher-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.info-card h3 {
    margin-top: 0;
    color: var(--primary);
    border-bottom: 2px solid var(--light);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary);
}

/* Section ruches */
.ruches-section {
    margin: 3rem 0;
}

.ruches-section h2 {
    margin-bottom: 1.5rem;
}

.ruches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.ruche-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    padding: 1.25rem;
    transition: transform 0.3s;
    border-left: 4px solid var(--secondary);
}

.ruche-card:hover {
    transform: translateY(-3px);
}

.ruche-card.ruche-inactive {
    opacity: 0.6;
    border-left-color: #ccc;
}

.ruche-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ruche-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.ruche-info p {
    margin: 0.4rem 0;
    font-size: 0.9rem;
    color: #666;
}

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-outline {
    background: white;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

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

.btn-danger:hover {
    background: #c0392b;
}

/* Leaflet custom styles */
.leaflet-popup-content {
    margin: 0.5rem;
}

.ruche-marker {
    background: none;
    border: none;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ruchers-grid {
        grid-template-columns: 1fr;
    }
    
    .ruches-grid {
        grid-template-columns: 1fr;
    }
    
    .rucher-info-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
