/* ==========================================================================
   CSS Variabelen & Reset
   ========================================================================== */
:root {
    --primary: #009ada;
    --primary-hover: #007eb3;
    --secondary: #636466;
    --secondary-hover: #4a4b4d;
    --success: #10b981;
    --danger: #f8931f;
    --danger-hover: #e07d15;
    --background: #f0f4f8;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.2s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Typografie & Knoppen */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: var(--secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-hover);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--danger-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary);
    color: white;
}

.btn-text {
    background-color: transparent;
    color: var(--primary);
    padding: 0.25rem;
    font-size: 0.8rem;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 154, 218, 0.15);
}

/* Editor & Symbolen */
.ql-toolbar {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    background-color: #f8fafc;
    font-family: 'Inter', sans-serif;
}

.ql-container {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    background-color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.ql-symbols::after {
    content: "✨";
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.symbol-btn {
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.symbol-btn:hover {
    background-color: var(--background) !important;
    transform: scale(1.1);
    border-color: var(--primary) !important;
}

/* Opmaak voor de output van de Teksteditor */
.rich-text-content p {
    margin-bottom: 0.5rem;
}

.rich-text-content ul,
.rich-text-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.rich-text-content a {
    color: var(--primary);
    text-decoration: underline;
}

.rich-text-content strong {
    font-weight: 700;
    color: var(--secondary);
}

.rich-text-content li.ql-indent-1 {
    margin-left: 1.5rem;
    list-style-type: circle;
}

.rich-text-content li.ql-indent-2 {
    margin-left: 3rem;
    list-style-type: square;
}

.rich-text-content li.ql-indent-3 {
    margin-left: 4.5rem;
    list-style-type: disc;
}

.rich-text-content li.ql-indent-4 {
    margin-left: 6rem;
    list-style-type: circle;
}

.rich-text-content li.ql-indent-5 {
    margin-left: 7.5rem;
    list-style-type: square;
}

.rich-text-content .ql-align-center {
    text-align: center;
    display: block;
}

.rich-text-content .ql-align-right {
    text-align: right;
    display: block;
}

.rich-text-content .ql-align-justify {
    text-align: justify;
    display: block;
}

/* Layout & Componenten */
#app-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0.75rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    border-top: 4px solid var(--primary);
}

.header-logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#user-role-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background-color: var(--secondary);
    color: white;
    text-transform: uppercase;
    font-weight: 700;
}

#user-name-display {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--secondary);
}

#btn-logout {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.view-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border-top: 5px solid var(--primary);
}

.login-card h1 {
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.header-button-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.content-panel {
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background-color: var(--secondary);
    color: white;
}

.panel-header h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
}

.agenda-list {
    list-style: none;
    padding: 0.75rem;
}

.agenda-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--background);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    transition: var(--transition);
}

.agenda-item:last-child {
    margin-bottom: 0;
}

.agenda-item:hover {
    background-color: #e6f3fa;
}

.agenda-item-content {
    flex: 1;
}

.agenda-item-content h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agenda-item-content h4 span.discussed-mark {
    color: var(--success);
    font-weight: bold;
}

.active-meeting-layout {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 100px);
}

.active-sidebar {
    width: 280px;
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-top: 4px solid var(--secondary);
}

.active-sidebar h3 {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    margin: 0;
    background-color: #f8fafc;
    font-size: 0.95rem;
}

.active-sidebar .agenda-item {
    margin: 0.25rem 0.5rem;
    padding: 0.75rem;
    border-left-width: 3px;
}

.active-sidebar .agenda-item.active-selection {
    background-color: var(--primary);
    color: white;
}

.active-sidebar .agenda-item.active-selection h4 {
    color: white;
}

.active-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.current-item-card {
    flex: 1;
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 2px solid var(--border);
    position: relative;
    overflow-y: auto;
}

.current-item-card::after {
    content: "👥";
    position: absolute;
    font-size: 12rem;
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
}

.current-item-card>* {
    z-index: 1;
}

.current-item-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
    text-transform: uppercase;
}

.current-item-card .rich-text-content {
    font-size: 1.35rem;
    max-width: 900px;
    line-height: 1.6;
    text-align: left;
}

.placeholder-text {
    color: var(--text-muted) !important;
    font-style: italic;
    font-weight: 400;
    font-size: 1.2rem;
}

.chairman-control-panel {
    background-color: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1rem;
    align-items: center;
    border-left: 5px solid var(--danger);
    flex-shrink: 0;
}

#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(99, 100, 102, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.custom-modal {
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalPop 0.2s ease-out;
    border-top: 4px solid var(--primary);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fcfcfc;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--secondary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--background);
}

#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10000;
}

.toast {
    background-color: var(--secondary);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    min-width: 280px;
    font-size: 0.9rem;
    animation: toastSlideIn 0.3s ease-out forwards;
    border-left: 4px solid transparent;
    font-weight: 500;
}

.toast.toast-success {
    border-left-color: var(--success);
}

.toast.toast-error {
    border-left-color: var(--danger);
}

.toast.toast-info {
    border-left-color: var(--primary);
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.drag-handle {
    cursor: grab;
    font-size: 1.5rem;
    color: var(--text-muted);
    padding-right: 1rem;
    padding-top: 0.2rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.drag-handle:hover {
    color: var(--primary);
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #f1f5f9;
}

/* ==========================================================================
   MOBILE FIRST OPTIMALISATIE
   ========================================================================== */
@media (max-width: 768px) {
    #app-container {
        padding: 0.5rem;
    }

    header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .header-logo {
        font-size: 1rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    #user-name-display {
        display: none;
    }

    #btn-logout {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .view-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .view-header h2 {
        font-size: 1.1rem;
        margin: 0;
    }

    .header-button-group {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.25rem;
    }

    .view-header .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .active-meeting-layout {
        flex-direction: column;
        height: calc(100vh - 75px);
        gap: 0.5rem;
    }

    .active-sidebar {
        width: 100%;
        max-height: 25vh;
        border-top: none;
        border-left: 4px solid var(--secondary);
    }

    .active-sidebar .agenda-item {
        padding: 0.5rem;
        margin: 0.2rem;
    }

    .active-sidebar h3 {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .active-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .current-item-card {
        flex: 1;
        padding: 1.5rem 1rem;
    }

    .current-item-card h2 {
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }

    .current-item-card .rich-text-content {
        font-size: 1rem;
    }

    .placeholder-text {
        font-size: 1rem;
    }

    .chairman-control-panel {
        padding: 0.75rem;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .chairman-control-panel button {
        flex: 1;
        min-width: 45%;
        margin: 0 !important;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}