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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #212529;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
}

.container {
    background: #212529;
    border-radius: 8px;
    max-width: 1600px;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
    text-align: center;
    width: 100%;
}

.template-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 12px 15px;
    width: 100%;
    max-width: 1400px;
}

.template-selector label {
    color: #e0e0e0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin: 0;
}

.template-selector select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 13px;
    background: #404040;
    color: #ffffff;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
}

.template-selector select:focus {
    outline: none;
    border-color: #888;
    background: #454545;
}

.btn-copy {
    background: #ff4757;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #ff3838;
}

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

.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 15px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    display: block;
    font-weight: 500;
    color: #e0e0e0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="date"],
input[type="time"],
input[type="number"] {
    width: 100%;
    padding: 12px 10px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 13px;
    background: #404040;
    color: #ffffff;
    transition: border-color 0.2s, background-color 0.2s;
    color-scheme: dark;
    height: 40px;
    box-sizing: border-box;
}

input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #888;
    background: #454545;
}

.preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
}

.raccourcis-title {
    color: #e0e0e0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 8px;
}

.btn-preset {
    background: #5a5a5a;
    color: #e0e0e0;
    padding: 8px 14px;
    font-size: 12px;
    border: 1px solid #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-preset:hover {
    background: #6a6a6a;
    border-color: #777;
}

.sections-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 1400px;
    margin-top: 25px;
}

.section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #555;
    padding-bottom: 6px;
}

.section-title {
    color: #e0e0e0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.message-section {
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 10px 15px 0 15px;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.message-content {
    font-family: 'Segoe UI', Roboto, sans-serif;
    color: #d0d0d0;
    margin: 0;
}

.discord-preview {
    background: #36393f;
    border: 1px solid #2c2f33;
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.discord-message {
    color: #dcddde;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.discord-timestamp {
    color: #72767d;
    text-decoration: none;
}

.discord-mention {
    color: #7289da;
    background: rgba(114, 137, 218, 0.1);
    padding: 0 2px;
    border-radius: 2px;
}

.discord-code {
    background: #2c2f33;
    border-radius: 3px;
    padding: 2px 4px;
    font-family: 'Courier New', monospace;
    color: #b5bdc9;
}

.feedback {
    text-align: center;
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
    opacity: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4caf50;
    border-radius: 6px;
    padding: 10px 20px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.feedback.show {
    opacity: 1;
}

.message-section::-webkit-scrollbar,
.discord-preview::-webkit-scrollbar {
    width: 6px;
}

.message-section::-webkit-scrollbar-track,
.discord-preview::-webkit-scrollbar-track {
    background: #3d3d3d;
}

.message-section::-webkit-scrollbar-thumb,
.discord-preview::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.message-section::-webkit-scrollbar-thumb:hover,
.discord-preview::-webkit-scrollbar-thumb:hover {
    background: #666;
}

@media (max-width: 1200px) {
    body {
        height: auto;
        overflow-y: auto;
        align-items: flex-start;
    }

    .container {
        height: auto;
        max-height: none;
        overflow: visible;
        padding-bottom: 20px;
    }

    .sections-wrapper {
        grid-template-columns: 1fr;
        flex: none;
        min-height: auto;
        margin-top: 10px;
    }

    .section {
        min-height: auto;
    }

    .message-section {
        flex: none;
        min-height: 280px;
        max-height: 400px;
        overflow-y: auto;
    }

    .discord-preview {
        flex: none;
        min-height: 280px;
        max-height: 400px;
        overflow-y: auto;
    }

    .feedback {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        height: auto;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 15px;
        gap: 10px;
    }

    h1 {
        font-size: 22px;
        padding-top: 10px;
    }

    .template-selector {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
        gap: 8px;
    }

    .template-selector select {
        width: 100%;
    }

    .template-selector label {
        font-size: 11px;
    }

    .template-selector select {
        font-size: 12px;
        padding: 7px 8px;
    }

    .btn-copy {
        padding: 6px 12px;
        font-size: 11px;
    }

    .input-section {
        padding: 12px;
        gap: 10px;
        max-width: 100%;
    }

    label {
        font-size: 11px;
    }

    input[type="date"],
    input[type="time"] {
        font-size: 12px;
        padding: 8px 8px;
    }

    .preset-buttons {
        max-width: 100%;
    }

    .btn-preset {
        padding: 6px 10px;
        font-size: 11px;
    }

    .message-section,
    .discord-preview {
        font-size: 11px;
        padding: 12px;
    }

    .section-title {
        font-size: 11px;
        margin-bottom: 6px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .container {
        padding: 10px;
        gap: 8px;
        border-radius: 0;
    }

    h1 {
        font-size: 17px;
        padding-top: 8px;
    }

    .template-selector {
        padding: 8px 10px;
        gap: 6px;
    }

    .template-selector label {
        font-size: 10px;
    }

    .template-selector select {
        font-size: 11px;
        padding: 6px;
    }

    .input-section {
        grid-template-columns: 1fr 1fr;
        padding: 10px;
        gap: 8px;
        max-width: 100%;
    }

    input[type="date"],
    input[type="time"] {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
        padding: 10px 6px;
        height: 44px;
    }

    .btn-copy {
        padding: 10px 14px;
        font-size: 12px;
        min-height: 44px;
    }

    .btn-preset {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 44px;
        flex: 1;
    }

    .preset-buttons {
        gap: 8px;
    }

    .message-section,
    .discord-preview {
        font-size: 11px;
        padding: 10px;
        min-height: 220px;
        max-height: 350px;
    }

    .discord-message,
    .message-content {
        font-size: 11px;
    }

    .section-title {
        font-size: 11px;
    }

    .feedback {
        bottom: 15px;
        font-size: 14px;
        padding: 10px 16px;
    }
}

@media (max-width: 380px) {
    h1 {
        font-size: 15px;
    }

    .input-section {
        grid-template-columns: 1fr;
    }

    .btn-preset {
        flex: 1 1 100%;
    }
}