/* Planning Julie - Style */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.subtitle {
    font-size: 15px;
    color: #86868b;
    margin-bottom: 32px;
    text-align: center;
}

/* Card */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.card p {
    font-size: 15px;
    color: #6e6e73;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Wide card for the preview table */
.card-wide {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 32px;
    width: 100%;
    max-width: 900px;
}

.card-wide h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    text-decoration: none;
    line-height: 1;
}

.btn:hover {
    opacity: 0.85;
}

.btn:active {
    transform: scale(0.98);
}

.btn-google {
    background-color: #4285f4;
    color: #ffffff;
}

.btn-primary {
    background-color: #007aff;
    color: #ffffff;
}

.btn-send {
    background-color: #34c759;
    color: #ffffff;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Logout bar */
.logout-bar {
    width: 100%;
    max-width: 900px;
    text-align: right;
    margin-bottom: 16px;
}

.btn-logout {
    font-size: 14px;
    color: #86868b;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.btn-logout:hover {
    background: #e8e8ed;
    color: #1d1d1f;
}

/* Calendar select */
.select-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d2d2d7;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #1d1d1f;
    background: #fafafa;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e73' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.select-input:focus {
    outline: none;
    border-color: #007aff;
}

.card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1d1d1f;
}

/* Upload form */
.upload-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.file-input-wrapper {
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    color: #6e6e73;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-input-wrapper input[type="file"]:hover {
    border-color: #007aff;
}

/* Spinner */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #d2d2d7;
    border-top-color: #007aff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 15px;
    color: #6e6e73;
}

/* Schedule table */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.schedule-table thead {
    background: #f5f5f7;
}

.schedule-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6e6e73;
    border-bottom: 2px solid #e8e8ed;
}

.schedule-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e8e8ed;
    vertical-align: middle;
}

.schedule-table tbody tr:last-child td {
    border-bottom: none;
}

/* Row colors by type */
.row-repos {
    background-color: #e8f5e9;
}

.row-recup {
    background-color: #fff3e0;
}

.row-vacances {
    background-color: #e3f2fd;
}

.row-ferie {
    background-color: #fce4ec;
}

/* Type badge */
.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.type-travail { background: #e8e8ed; color: #1d1d1f; }
.type-repos { background: #c8e6c9; color: #2e7d32; }
.type-recup { background: #ffe0b2; color: #e65100; }
.type-vacances { background: #bbdefb; color: #1565c0; }
.type-ferie { background: #f8bbd0; color: #c62828; }

/* Editable table fields */
.edit-select {
    padding: 4px 8px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

.edit-select:focus {
    outline: none;
    border-color: #007aff;
}

.edit-horaires {
    width: 100%;
    min-width: 180px;
    padding: 4px 8px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

.edit-horaires:focus {
    outline: none;
    border-color: #007aff;
}

.edit-horaires::placeholder {
    color: #c7c7cc;
}

/* Actions area */
.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

/* Confirmation message */
.confirmation {
    display: none;
    text-align: center;
    padding: 24px;
}

.confirmation.active {
    display: block;
}

.confirmation-text {
    font-size: 18px;
    font-weight: 600;
    color: #34c759;
    margin-bottom: 8px;
}

.confirmation-sub {
    font-size: 14px;
    color: #6e6e73;
}

/* Error message */
.error-message {
    display: none;
    background: #fff2f2;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 12px 16px;
    color: #c62828;
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
}

.error-message.active {
    display: block;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 20px 12px;
    }

    h1 {
        font-size: 22px;
    }

    .card {
        padding: 24px 20px;
    }

    .card-wide {
        padding: 16px;
    }

    .card-wide h2 {
        font-size: 17px;
    }

    .schedule-table {
        font-size: 13px;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 8px 10px;
    }

    .btn-send {
        width: 100%;
    }
}
