/* === STYLE RÉTRO ANNÉES 2000 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: linear-gradient(to bottom, #6699CC 0%, #99CCFF 100%);
    min-height: 100vh;
    padding: 20px;
    background-image: url('windowsxp.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #C0C0C0;
    border: 4px outset #FFFFFF;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
}

/* Barre de titre style Windows 95 */
.title-bar {
    background: linear-gradient(to right, #000080, #1084D0);
    color: white;
    padding: 5px 10px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-bar-buttons {
    display: flex;
    gap: 2px;
}

.title-bar-button {
    width: 16px;
    height: 14px;
    border: 1px outset white;
    background: #C0C0C0;
    font-size: 9px;
    text-align: center;
    line-height: 12px;
    cursor: pointer;
}

h1 {
    text-align: center;
    padding: 20px;
    color: #FF00FF;
    text-shadow: 2px 2px 0px #0000FF, 4px 4px 0px #00FFFF;
    font-size: 2.5em;
    background: linear-gradient(90deg, #FF0000, #FF00FF, #0000FF, #00FFFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.content {
    padding: 20px;
    background: #FFFFFF;
    border: 2px inset #808080;
    margin: 10px;
}

/* Formulaire d'ajout */
.form-group {
    background: #E0E0E0;
    border: 2px groove #FFFFFF;
    padding: 15px;
    margin-bottom: 20px;
}

.form-group legend {
    color: #000080;
    font-weight: bold;
    font-size: 16px;
    padding: 0 5px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #000000;
    font-weight: bold;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 5px;
    border: 2px inset #808080;
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin-bottom: 10px;
    background: #FFFFFF;
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: 1px dotted #000000;
    background: #FFFFCC;
}

button {
    background: #C0C0C0;
    border: 2px outset #FFFFFF;
    padding: 8px 20px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

button:hover {
    background: #D0D0D0;
}

button:active {
    border-style: inset;
    box-shadow: inset 2px 2px 0px rgba(0,0,0,0.3);
}

.btn-add {
    background: #00AA00;
    color: white;
    font-size: 16px;
    width: 100%;
}

.btn-delete {
    background: #FF0000;
    color: white;
    padding: 5px 15px;
    font-size: 12px;
}

.btn-delete::before {
    content: none;
}

.btn-text-desktop {
    display: inline;
}

/* Liste des résolutions */
.resolutions-list {
    margin-top: 20px;
}

/* Section téléchargement PDF */
.download-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 3px double #808080;
    text-align: center;
}

.btn-download-pdf {
    background: linear-gradient(to bottom, #0000FF, #000080);
    color: #FFFF00;
    font-size: 18px;
    padding: 15px 40px;
    width: 100%;
    max-width: 500px;
    border: 3px outset #0000FF;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-download-pdf:hover {
    background: linear-gradient(to bottom, #0000CC, #000060);
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px rgba(0,0,0,0.5);
}

.btn-download-pdf:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

.resolution-item {
    background: #F0F0F0;
    border: 2px ridge #808080;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.resolution-item:hover {
    background: #FFFFCC;
    border-color: #0000FF;
}

.resolution-info {
    flex: 1;
}

.resolution-text {
    font-size: 18px;
    color: #000080;
    font-weight: bold;
    margin-bottom: 5px;
}

.resolution-date {
    font-size: 14px;
    color: #0000FF;
    font-style: italic;
}

.overdue {
    color: #FF0000 !important;
    font-weight: bold;
}

.overdue-badge {
    background: #FF0000;
    color: #FFFFFF;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 10px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #808080;
    font-style: italic;
    border: 2px dashed #C0C0C0;
}

/* Footer rétro */
.footer {
    text-align: center;
    padding: 15px;
    background: #C0C0C0;
    border-top: 2px ridge #FFFFFF;
    margin: 10px;
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.footer a {
    color: #0000FF;
    text-decoration: underline;
    cursor: pointer;
}

.footer a:visited {
    color: #800080;
}

.footer a:hover {
    color: #FF0000;
}

/* Compteur */
.counter {
    background: #000080;
    color: #00FF00;
    padding: 10px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    border: 2px inset #808080;
    margin: 10px;
}

/* Styles pour l'impression PDF */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        border: none;
        box-shadow: none;
        background: white;
    }

    .title-bar,
    .counter,
    .form-group,
    .footer,
    .btn-delete,
    .download-section {
        display: none !important;
    }

    .content {
        border: none;
        margin: 0;
        padding: 20px;
    }

    h1 {
        color: black !important;
        text-shadow: none;
        -webkit-text-fill-color: black;
        background: none;
        animation: none;
    }

    .resolution-item {
        page-break-inside: avoid;
        border: 1px solid #000;
        background: white !important;
        padding: 15px;
        margin-bottom: 15px;
        display: flex;
        align-items: flex-start;
    }

    .resolution-item:hover {
        background: white !important;
        border-color: #000 !important;
    }

    .print-checkbox {
        display: inline-block !important;
        width: 20px;
        height: 20px;
        border: 2px solid #000;
        margin-right: 15px;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .resolution-text,
    .resolution-date {
        color: #000 !important;
    }

    .overdue-badge {
        background: #000;
        color: #fff;
    }
}

.print-checkbox {
    display: none;
}

/* Modal Windows 98 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-window {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    min-width: 350px;
    max-width: 500px;
}

.modal-content {
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.modal-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.modal-text {
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
    color: #000;
    flex: 1;
}

.modal-buttons {
    padding: 10px 20px 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-modal {
    font-family: 'MS Sans Serif', Arial, sans-serif;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    padding: 5px 20px;
    font-size: 13px;
    cursor: pointer;
    min-width: 75px;
}

.btn-modal:hover {
    background: #d4d4d4;
}

.btn-modal:active {
    border-color: #000000 #ffffff #ffffff #000000;
    padding: 6px 19px 4px 21px;
}

/* ============================================
   RESPONSIVE - MOBILE APP STYLE
   ============================================ */

@media (max-width: 768px) {
    body {
        padding: 0;
        background-attachment: scroll;
    }

    .container {
        max-width: 100%;
        margin: 0;
        border: none;
        box-shadow: none;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        border-radius: 0;
    }

    /* Header fixe style app mobile */
    .title-bar {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 12px 15px;
        font-size: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .title-bar-buttons {
        display: none;
    }

    h1 {
        font-size: 1.5em;
        padding: 15px 10px;
        margin: 0;
        position: sticky;
        top: 36px;
        z-index: 99;
        background: #C0C0C0;
        border-bottom: 2px solid #808080;
    }

    .counter {
        position: sticky;
        top: 96px;
        z-index: 98;
        margin: 0;
        padding: 12px;
        font-size: 14px;
        border-radius: 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .content {
        flex: 1;
        margin: 0;
        padding: 15px;
        border: none;
        overflow-y: auto;
    }

    /* Formulaire optimisé mobile */
    .form-group {
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
    }

    .form-group legend {
        font-size: 14px;
    }

    input[type="text"],
    input[type="date"] {
        font-size: 16px;
        padding: 12px;
        border-radius: 4px;
        -webkit-appearance: none;
        appearance: none;
    }

    .btn-add {
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 8px;
        touch-action: manipulation;
    }

    /* Liste des résolutions optimisée */
    .resolutions-list {
        margin-top: 15px;
    }

    .resolution-item {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 15px;
        margin-bottom: 12px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .resolution-info {
        flex: 1;
        margin-bottom: 0;
    }

    .resolution-text {
        font-size: 17px;
        margin-bottom: 8px;
        word-wrap: break-word;
    }

    .resolution-date {
        font-size: 14px;
    }

    .btn-delete {
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 0;
        font-size: 20px;
        border-radius: 50%;
        touch-action: manipulation;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .btn-delete::before {
        content: '✕';
    }
    
    .btn-text-desktop {
        display: none;
    }

    /* Section téléchargement */
    .download-section {
        margin-top: 20px;
        padding: 15px;
        position: sticky;
        bottom: 0;
        background: #FFFFFF;
        border-top: 3px double #808080;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    }

    .btn-download-pdf {
        padding: 15px 30px;
        font-size: 16px;
        width: 100%;
        max-width: 100%;
        border-radius: 8px;
        touch-action: manipulation;
    }

    /* Footer mobile */
    .footer {
        margin: 0;
        padding: 15px;
        font-size: 11px;
        border-radius: 0;
    }

    .footer marquee {
        width: 150px !important;
    }

    /* Modal adapté mobile */
    .modal-overlay {
        padding: 20px;
    }

    .modal-window {
        min-width: auto;
        max-width: 100%;
        width: 100%;
        border-radius: 8px;
        overflow: hidden;
    }

    .modal-content {
        padding: 20px 15px;
    }

    .modal-text {
        font-size: 15px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .btn-modal {
        width: 100%;
        padding: 12px;
        font-size: 15px;
        border-radius: 6px;
    }

    .btn-modal:active {
        padding: 13px 20px 11px 20px;
    }

    /* Optimisation des animations pour mobile */
    @keyframes rainbow {
        0%, 100% { filter: hue-rotate(0deg); }
        50% { filter: hue-rotate(180deg); }
    }
}

/* Très petit mobile (< 375px) */
@media (max-width: 374px) {
    h1 {
        font-size: 1.2em;
        padding: 12px 8px;
    }

    .counter {
        font-size: 12px;
        padding: 10px;
    }

    .content {
        padding: 10px;
    }

    .form-group {
        padding: 12px;
    }

    .resolution-text {
        font-size: 14px;
    }

    .resolution-date {
        font-size: 12px;
    }
}

/* Orientation paysage mobile */
@media (max-width: 768px) and (orientation: landscape) {
    h1 {
        font-size: 1.2em;
        padding: 10px;
    }

    .counter {
        font-size: 13px;
        padding: 8px;
    }

    .form-group {
        padding: 12px;
    }
}
