/* assets/css/style.css */
:root {
    --main-color: #2ef24c;
    --dark-color: #143617;
    --glow-color: rgba(46, 242, 76, 0.4);
    --bg-color: #0a0a0a;
    --error-color: #ff4747;
    --warning-color: #ffd700;
    --scan-line-color: rgba(46, 242, 76, 0.1);
}

@font-face {
    font-family: 'VaultTec';
    src: url('../fonts/Share-Tech-Mono.ttf') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'VaultTec', monospace;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-color);
    color: var(--main-color);
}

.terminal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    border: 2px solid var(--main-color);
    border-radius: 15px;
    overflow: hidden; /* Important */
}

.terminal-section::-webkit-scrollbar {
    width: 8px;
}

.terminal-section::-webkit-scrollbar-track {
    background: var(--dark-color);
}

.terminal-section::-webkit-scrollbar-thumb {
    background-color: var(--main-color);
    border-radius: 4px;
}

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.page-btn {
    background: transparent;
    border: 1px solid var(--main-color);
    color: var(--main-color);
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn.active,
.page-btn:hover {
    background: var(--main-color);
    color: var(--dark-color);
}

.message-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.message-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-color);
    border: 2px solid var(--main-color);
    width: 90%;
    max-width: 600px;
    margin: auto;
    padding: 20px;
    position: relative;
    box-shadow: 0 0 20px var(--glow-color);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--main-color);
    font-size: 24px;
    cursor: pointer;
}

.screen-overlay {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(46, 242, 76, 0.03) 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    z-index: 2;
    opacity: 0.3;
}

.terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--main-color);
    border-radius: 15px;
    animation: glowPulse 2s infinite;
    z-index: -1;
}

.terminal-header {
    padding: 20px;
    background: var(--bg-color);
    border-bottom: 2px solid var(--main-color);
    z-index: 3;
}

.announcement-card {
    background: rgba(20, 54, 23, 0.3);
    border: 1px solid var(--main-color);
    margin-bottom: 20px;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.announcement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--main-color);
}

.announcement-card[data-priority="high"]::before {
    background: #ff4747;
}

.announcement-card[data-priority="medium"]::before {
    background: #ffd700;
}

.announcement-card .message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(46, 242, 76, 0.3);
}

.announcement-card h3 {
    color: var(--main-color);
    font-size: 1.2em;
    margin-bottom: 10px;
    text-transform: uppercase;
    background: rgba(46, 242, 76, 0.1);
    padding: 5px 10px;
}

.announcement-date {
    color: var(--main-color);
    opacity: 0.8;
}

.announcement-priority {
    padding: 3px 8px;
    background: rgba(46, 242, 76, 0.1);
    border: 1px solid var(--main-color);
    font-size: 0.9em;
}

.announcement-content {
    line-height: 1.5;
    white-space: pre-line;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
}


.terminal-footer {
    padding: 10px 20px;
    background: var(--bg-color);
    border-top: 1px solid var(--main-color);
    z-index: 3;
}

.terminal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
}

.status-lights {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--main-color);
    animation: blink 3s infinite;
}

.light:nth-child(2) {
    animation-delay: 1s;
}

.light:nth-child(3) {
    animation-delay: 2s;
}

.terminal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.terminal-sections-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


.terminal-nav {
    padding: 10px 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--main-color);
    display: flex;
    gap: 10px;
    z-index: 100;
    position: sticky;
    top: 0;
    flex-wrap: wrap;
}

.form-container {
    max-width: 500px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

input, textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: var(--dark-color);
    border: 1px solid var(--main-color);
    color: var(--main-color);
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 15px var(--glow-color);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button {
    background: transparent;
    border: 2px solid var(--main-color);
    color: var(--main-color);
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: var(--main-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--glow-color);
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: var(--main-color);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

button:active::before {
    opacity: 0.1;
}

.message-container {
    border: 1px solid var(--main-color);
    padding: 15px;
    margin: 15px 0;
    position: relative;
    background: var(--dark-color);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(46, 242, 76, 0.3);
}

.message-subject {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--main-color);
}


.terminal-section {
    display: none; /* Important: cacher toutes les sections par défaut */
    height: calc(100vh - 250px); /* Hauteur fixe pour le scroll */
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-color);
}


.terminal-section.active {
    display: block;
}

.terminal-section:first-child {
    border-top: none;
}


.nav-btn {
    background: transparent;
    border: 1px solid var(--main-color);
    color: var(--main-color);
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

.nav-btn:hover, 
.nav-btn.active {
    background: var(--main-color);
    color: var(--dark-color);
    box-shadow: 0 0 10px var(--glow-color);
}

.logout {
    float: right;
}

.suggestions-box {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: var(--dark-color);
    border: 1px solid var(--main-color);
    margin-top: 0;
    z-index: 1000;
    box-shadow: 0 0 10px var(--glow-color);
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(46, 242, 76, 0.2);
    transition: all 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--main-color);
    color: var(--bg-color);
}

.form-group {
    position: relative;
    margin-bottom: 20px;
}

.terminal-input {
    width: 100%;
    padding: 12px;
    background: var(--dark-color);
    border: 1px solid var(--main-color);
    color: var(--main-color);
    font-family: 'VaultTec', monospace;
    font-size: 16px;
    transition: all 0.3s ease;
}

.terminal-input:focus {
    outline: none;
    box-shadow: 0 0 15px var(--glow-color);
}


/* Modification des styles pour les sections */
.terminal-section {
    display: none; /* Important: cacher toutes les sections par défaut */
    height: calc(100vh - 250px); /* Hauteur fixe pour le scroll */
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-color);
}

.terminal-section.active {
    display: block;
}

/* Style pour la navigation */
.terminal-nav {
    padding: 10px 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--main-color);
    display: flex;
    gap: 10px;
    z-index: 100;
    position: sticky;
    top: 0;
    flex-wrap: wrap;
}

/* Style pour le conteneur des sections */
.terminal-sections-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Ajustement du conteneur principal */
.terminal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Style spécifique pour les annonces */
#announcements .announcement-card {
    border: 1px solid var(--main-color);
    border-radius: 4px;
    margin-bottom: 20px;
    position: relative;
}

#announcements .announcement-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

#announcements .announcement-card[data-priority="high"]::before {
    background-color: var(--error-color);
}

#announcements .announcement-card[data-priority="medium"]::before {
    background-color: var(--warning-color);
}

/* Style pour les titres de section */
.terminal-section h2 {
    color: var(--main-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--main-color);
}


/* Animations */
@keyframes bootSequence {
    0% {
        opacity: 0;
        transform: scale(0.95) rotateX(10deg);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateX(0);
    }
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100vh);
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px var(--glow-color);
    }
    50% {
        box-shadow: 0 0 20px var(--glow-color);
    }
    100% {
        box-shadow: 0 0 5px var(--glow-color);
    }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Messages styles */
.message-card {
    background: rgba(20, 54, 23, 0.3);
    border: 1px solid var(--main-color);
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 15px;
    transition: all 0.3s ease;
}

.message-card.unread {
    border-left: 4px solid var(--main-color);
    background: rgba(46, 242, 76, 0.1);
}
.message-card:hover {
    box-shadow: 0 0 10px var(--glow-color);
}

.message-preview {
    color: rgba(46, 242, 76, 0.8);
    margin-bottom: 15px;
    line-height: 1.4;
}

.read-btn {
    width: 100%;
    padding: 8px;
}

.messages-container {
    margin-top: 20px;
}

.no-messages {
    text-align: center;
    padding: 20px;
    color: var(--main-color);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .terminal {
        width: 95vw;
        height: 95vh;
        margin: 0;
    }
    
    .terminal-content {
        padding: 15px;
    }
    
    .nav-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .message-header {
        flex-direction: column;
        gap: 5px;
    }
}

@keyframes fadeInSuggestions {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestions-box {
    animation: fadeInSuggestions 0.2s ease;
}