/* Common CSS for all pages - Brocante de Saint Julien de Coppel */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Common Colors and Gradients */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #ffc107;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --background-light: #f5f7fa;

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    --gradient-danger: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    --gradient-warning: linear-gradient(135deg, #ffc107 0%, #ffa000 100%);
    --gradient-light: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Common Typography */
h1 {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

h2 {
    color: var(--primary-color);
    font-weight: 600;
}

h3 {
    color: var(--primary-color);
    font-weight: 600;
}

/* Common Buttons */
button, .btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button[type="submit"], .btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

button:disabled, .btn:disabled {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
}

.btn-danger, .btn-logout, .btn-cancel {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover, .btn-logout:hover, .btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.btn-warning {
    background: var(--gradient-warning);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

/* Common Form Elements */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"],
select {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

label {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95em;
}

/* Common Containers */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Common Messages */
.error {
    color: #d32f2f;
    padding: 15px;
    background: #ffebee;
    border: 2px solid var(--danger-color);
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 500;
}

.success {
    color: #388e3c;
    padding: 15px;
    background: #e8f5e9;
    border: 2px solid var(--success-color);
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 500;
}

.warning {
    color: #f57c00;
    padding: 15px;
    background: #fff3e0;
    border: 2px solid var(--warning-color);
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 500;
}

#loading {
    padding: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
}

/* Common Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

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

th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #f8f9fa;
}

tr:last-child td {
    border-bottom: none;
}

/* Common Header (for pages with header) */
header {
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logo {
    position: absolute;
    top: 15px;
    left: 15px;
    height: 60px;
    z-index: 10;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

header img:not(.logo) {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Common Footer */
footer {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    font-size: 1.1em;
}

/* Common Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 15px auto;
        width: 98%;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.3em;
    }

    header img:not(.logo) {
        height: 160px;
    }

    .logo {
        height: 45px;
        top: 10px;
        left: 10px;
    }

    footer {
        padding: 20px 15px;
        font-size: 0.95em;
    }

    /* Scrollable tables on mobile */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.85em;
        border-radius: 10px;
    }

    th, td {
        padding: 10px 8px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    button, .btn {
        padding: 12px 18px;
        font-size: 0.95em;
    }

    h1 {
        font-size: 1.5em;
    }

    header img:not(.logo) {
        height: 110px;
    }

    .logo {
        height: 34px;
        top: 8px;
        left: 8px;
    }

    footer {
        padding: 15px 10px;
        font-size: 0.88em;
    }

    th, td {
        padding: 8px 6px;
        font-size: 0.8em;
    }
}

/* Cookie Consent Overlay */
#cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

#cookie-banner {
    background: #1e1e1e;
    color: #f0f0f0;
    padding: 36px 40px;
    border-radius: 16px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    font-size: 0.95em;
}

#cookie-banner h2 {
    color: var(--warning-color);
    font-size: 1.4em;
    margin: 0;
}

#cookie-banner p {
    margin: 0;
    line-height: 1.6;
    color: #ccc;
}

#cookie-accept-btn {
    background: var(--gradient-success);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px 36px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
}

#cookie-accept-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

body.cookie-locked {
    overflow: hidden;
    pointer-events: none;
}

body.cookie-locked #cookie-overlay {
    pointer-events: all;
}
