@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== VARIABLES CSS ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --button-primary: #0066ff;
    --button-hover: #0052cc;
    --button-success: #22c55e;
    --accent: #0066ff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #121212;
        --bg-secondary: #1e1e1e;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --border-color: #333333;
        --button-primary: #0066ff;
        --button-hover: #0052cc;
        --button-success: #22c55e;
        --accent: #0066ff;
    }
}

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

/* ===== BODY ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ===== LOGIN PAGE ===== */
.login-box {
    background: var(--bg-secondary);
    padding: 28px;
    border-radius: 8px;
    width: 100%;
    max-width: 320px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: auto;
    margin: auto;
}

.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    outline: none;
    font-size: 14px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--accent);
}

#error {
    color: #dc2626;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    min-height: 20px;
}

#loginBtn {
    width: 100%;
    border-radius: 999px;
    padding: 14px 20px;
    font-size: 15px;
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 22px;
        border-radius: 14px;
        max-width: 360px;
    }

    .login-box h2 {
        font-size: 24px;
        margin-bottom: 26px;
    }

    #loginBtn {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* ===== BUTTONS ===== */
button {
    padding: 12px 20px;
    background-color: var(--button-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s;
    font-family: 'Inter', sans-serif;
}

button:hover:not(:disabled) {
    background-color: var(--button-hover);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-success {
    background-color: var(--button-success);
    color: white;
}

.btn-success:hover {
    background-color: #16a34a;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-rounded {
    border-radius: 999px;
}

.btn-text {
    background: none;
    color: var(--accent);
    border: none;
    padding: 8px 0;
    cursor: pointer;
    font-weight: 500;
}

.btn-text:hover {
    text-decoration: underline;
}

/* ===== HEADER ===== */
.header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.avatar-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.2s;
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-button:hover {
    background-color: var(--border-color);
}

.avatar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 101;
}

.avatar-menu.hidden {
    display: none;
}

.avatar-menu button {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 0;
    background: none;
    color: var(--text-primary);
    border: none;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.avatar-menu button:hover {
    background-color: var(--border-color);
}

.logout-option {
    color: #dc2626;
}

.logout-option:hover {
    background-color: rgba(220, 38, 38, 0.1);
}

/* ===== FILTER CHIPS ===== */
.filter-chips-container {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 50;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.filter-chip {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.filter-chip:hover {
    background-color: var(--border-color);
}

.filter-chip.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

.chip-badge {
    font-size: 12px;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.filter-chip.active .chip-badge {
    background-color: rgba(255, 255, 255, 0.4);
}

/* ===== DASHBOARD CONTAINER ===== */
.dashboard-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ===== SECTIONS ===== */.dashboard-section h2 {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.dashboard-section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ===== CARDS ===== */
.video-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.video-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.idea-menu-wrapper {
    position: relative;
    margin-left: auto;
    align-self: flex-start;
}

.idea-menu-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.idea-menu-button:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.idea-card-menu {
    position: absolute;
    top: 36px;
    right: 0;
    min-width: 150px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    display: none;
    z-index: 5;
}

.idea-card-menu.open {
    display: block;
}

.idea-menu-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.idea-menu-item:hover {
    background-color: var(--border-color);
}

.idea-menu-item.danger {
    color: #dc2626;
}

.idea-menu-item.danger:hover {
    background-color: rgba(220, 38, 38, 0.12);
}

/* ===== INVITATION CARDS ===== */
.invitation-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: auto;
}

.invitation-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.invitation-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.invitation-card-content.invitation-rejected {
    opacity: 0.7;
}

.invitation-creator-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.invitation-thumbnail-container {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background-color: var(--border-color);
    background-size: cover;
    background-position: center;
    overflow: visible;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 4px;
}

.invitation-creator-avatar-overlay {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-secondary);
    position: absolute;
    bottom: 0;
    right: 0;
}

.invitation-text-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invitation-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.invitation-title strong {
    font-weight: 600;
    color: var(--accent);
}

.invitation-participants {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 4px;
}

.participant-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    object-fit: cover;
    margin-left: -10px;
    flex-shrink: 0;
}

.participant-avatar:first-child {
    margin-left: 0;
}

.participant-extra {
    background-color: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    cursor: default;
}

.invitation-rejected-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: #dc2626;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    width: fit-content;
}

.invitation-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.circular-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.circular-accept {
    background-color: var(--button-success);
    color: white;
}

.circular-accept:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.circular-reject {
    background-color: #dc2626;
    color: white;
}

.circular-reject:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.video-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.video-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.video-card-thumbnail {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 4px;
    background-color: var(--border-color);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.video-card-content {
    flex: 1;
    min-width: 0;
}

.video-card-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== PARTICIPANTS AVATARS ===== */
.video-participants {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.video-participants-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.participant-list {
    width: 100%;
}

.avatars-container {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    height: 36px;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    object-fit: cover;
    position: relative;
    margin-left: -12px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.avatar-circle:hover {
    transform: scale(1.1);
    z-index: 10 !important;
}

.avatar-circle:first-child {
    margin-left: 0;
}

.avatar-extra {
    background-color: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    cursor: default;
}

.video-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background-color: #fed7aa;
    color: #92400e;
}

@media (prefers-color-scheme: dark) {
    .status-pending {
        background-color: #b45309;
        color: #fef3c7;
    }
}

.status-invited {
    background-color: #fed7aa;
    color: #92400e;
}

@media (prefers-color-scheme: dark) {
    .status-invited {
        background-color: #b45309;
        color: #fef3c7;
    }
}

.status-accepted {
    background-color: #86efac;
    color: #14532d;
}

@media (prefers-color-scheme: dark) {
    .status-accepted {
        background-color: #16a34a;
        color: #dcfce7;
    }
}

.status-rejected {
    background-color: #fca5a5;
    color: #7f1d1d;
}

@media (prefers-color-scheme: dark) {
    .status-rejected {
        background-color: #dc2626;
        color: #fee2e2;
    }
}

.status-recording {
    background-color: #dbeafe;
    color: #0c2340;
}

@media (prefers-color-scheme: dark) {
    .status-recording {
        background-color: #0c2340;
        color: #93c5fd;
    }
}

.status-completed {
    background-color: #dcfce7;
    color: #14532d;
}

@media (prefers-color-scheme: dark) {
    .status-completed {
        background-color: #14532d;
        color: #86efac;
    }
}

.video-progress {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state small {
    font-size: 13px;
}

/* ===== FAB (Floating Action Button) ===== */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--button-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 32px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    z-index: 50;
}

.fab:hover {
    background-color: var(--button-hover);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.fab:active {
    transform: scale(0.95);
}

/* ===== COLLABORATORS LIST ===== */
.collaborators-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.collaborator-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.collaborator-item:hover {
    background-color: var(--bg-secondary);
}

.collaborator-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    accent-color: var(--accent);
}

.collaborator-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.collaborator-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.collaborator-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.collaborator-character {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: auto;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer button {
    flex: 1;
}

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ===== COLLABORATORS ===== */
.collaborators-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background-color: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.collaborator-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.collaborator-item:hover {
    background-color: var(--bg-secondary);
}

.collaborator-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    accent-color: var(--accent);
}

.collaborator-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.collaborator-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.collaborator-character {
    font-size: 12px;
    color: var(--text-secondary);
}

.collaborator-item input[type="checkbox"]:checked + .collaborator-text {
    font-weight: 600;
}

/* ===== REFERENCES ===== */
.references-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.reference-item {
    display: grid;
    grid-template-columns: 1fr 150px 40px;
    gap: 8px;
    align-items: end;
}

.ref-url {
    grid-column: 1;
}

.ref-title {
    grid-column: 2;
}

.btn-remove-ref {
    background-color: #dc2626;
    padding: 10px;
    font-size: 18px;
    width: 100%;
}

.btn-remove-ref:hover {
    background-color: #b91c1c;
}

.btn-add-ref {
    background-color: var(--button-success);
    padding: 10px;
    color: white;
    margin-top: 5px;
    width: auto;
}

.btn-add-ref:hover {
    background-color: #16a34a;
}

@media screen and (max-width: 768px) {
    body {
        padding: 15px;
    }

    .header {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        justify-content: space-between;
        padding-top: 50px;
        position: static;
    }

    .header-left {
        width: auto;
        flex: 1;
    }

    .header h1 {
        font-size: 32px;
        font-weight: 700;
    }

    .header-right {
        width: auto;
        justify-content: flex-end;
    }

    .filter-chips-container {
        padding: 12px 15px;
        overflow-x: auto;
        gap: 8px;
    }

    .filter-chip {
        padding: 6px 12px;
        font-size: 13px;
    }

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

    .modal {
        align-items: flex-end;
        justify-content: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .modal-header {
        justify-content: space-between;
        padding: 16px;
        position: sticky;
        top: 0;
        align-items: center;
        display: flex;
        flex-direction: row;
        gap: 12px;
        background-color: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        z-index: 10;
    }

    .modal-header h2 {
        flex: 1;
        margin: 0;
        font-size: 18px;
    }

    .modal-close {
        font-size: 28px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: center;
        position: static;
        flex-shrink: 0;
        cursor: pointer;
        padding: 0;
    }

    .modal-close:hover {
        background-color: var(--border-color);
    }

    .modal-body {
        padding-bottom: 80px;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        display: flex;
        gap: 10px;
        padding: 20px;
        border-top: 1px solid var(--border-color);
        background-color: var(--bg-primary);
        z-index: 10;
    }

    .reference-item {
        grid-template-columns: 1fr;
    }

    .btn-remove-ref {
        width: 100%;
        margin-top: 5px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 32px;
    }

    .header h2 {
        font-size: 14px;
    }

    .modal {
        align-items: flex-end;
        justify-content: flex-end;
    }

    .modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0;
    }

    .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 16px;
        position: sticky;
        top: 0;
        background-color: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        z-index: 10;
    }

    .modal-header h2 {
        flex: 1;
        margin: 0;
        font-size: 16px;
    }

    .modal-close {
        font-size: 28px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: center;
        position: static;
        flex-shrink: 0;
        cursor: pointer;
        padding: 0;
    }

    .modal-close:hover {
        background-color: var(--border-color);
    }

    .modal-body {
        padding-bottom: 80px;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        display: flex;
        gap: 10px;
        padding: 20px;
        border-top: 1px solid var(--border-color);
        background-color: var(--bg-primary);
        z-index: 10;
        flex-wrap: wrap;
    }

    .modal-footer button {
        flex: 1;
        min-width: 100px;
    }

    button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .fab {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .video-card {
        flex-direction: column;
    }

    .video-card-header {
        flex-direction: column;
    }

    .video-card-content {
        min-height: auto;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
    }
}

/* ===== APP DIALOG ===== */
.app-dialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.app-dialog.hidden {
    display: none;
}

.app-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.app-dialog-card {
    position: relative;
    z-index: 1;
    width: min(90%, 420px);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    animation: dialog-in 0.2s ease forwards;
}

.app-dialog-message {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.app-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

@keyframes dialog-in {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ===== TOASTS ===== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1300;
}

.toast {
    min-width: 220px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-color: #16a34a;
}

.toast-error {
    border-color: #dc2626;
}

.toast-info {
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .toast-container {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        align-items: center;
    }

    .toast {
        width: 100%;
        max-width: 520px;
    }
}