/* ========================================
   StarFormularioV2 - Main Styles
   Complete CSS Import
======================================== */

/* Import all CSS modules */
@import url('variables.css');
@import url('base.css');
@import url('components.css');
@import url('layout.css');
@import url('effects.css');

/* ===== INDEX.HTML SPECIFIC ===== */

/* Form Modal */
.form-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.2s ease;
    padding: var(--space-4);
}

.form-modal-content {
    background: var(--bg-card-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

body.dark-mode .form-modal-content {
    background: var(--bg-card-dark);
}

.form-modal-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    font-size: 28px;
    color: var(--text-dark-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: var(--space-2);
    line-height: 1;
    transition: color var(--transition-fast);
    z-index: 10;
}

body.dark-mode .form-modal-close {
    color: var(--text-light-muted);
}

.form-modal-close:hover {
    color: var(--primary);
}

/* User Profile Modal */
.user-profile-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.2s ease;
    padding: var(--space-4);
}

.user-profile-modal-content {
    background: var(--bg-card-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

body.dark-mode .user-profile-modal-content {
    background: var(--bg-card-dark);
}

.user-profile-modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    font-size: 28px;
    color: var(--text-dark-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: var(--space-2);
    line-height: 1;
    transition: color var(--transition-fast);
}

body.dark-mode .user-profile-modal-close {
    color: var(--text-light-muted);
}

.user-profile-modal-close:hover {
    color: var(--primary);
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

body.dark-mode .user-profile-header {
    border-bottom-color: var(--border-dark);
}

.user-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    border: 3px solid var(--primary);
}

.user-profile-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.user-profile-name {
    font-size: var(--font-size-xl);
    color: var(--primary);
    margin: 0;
}

.profile-forms h3 {
    margin-bottom: var(--space-4);
    color: var(--text-dark);
}

body.dark-mode .profile-forms h3 {
    color: var(--text-light);
}

/* Logo/Brand */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-lg);
}

/* Hero Buttons */
.hero-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

/* Status Section */
.user-status {
    background: var(--bg-card-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin: var(--space-6) auto;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

body.dark-mode .user-status {
    background: var(--bg-card-dark);
}

.user-status img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    border: 3px solid var(--primary);
    margin-bottom: var(--space-3);
}

.user-status h3 {
    color: var(--primary);
    margin-bottom: var(--space-3);
}

.user-status p {
    margin: var(--space-2) 0;
}

/* Form Selection Modal */
.form-selection-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.2s ease;
}

.form-selection-modal-content {
    background: var(--bg-card-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

body.dark-mode .form-selection-modal-content {
    background: var(--bg-card-dark);
}

.form-selection-modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    font-size: 28px;
    color: var(--text-dark-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

body.dark-mode .form-selection-modal-close {
    color: var(--text-light-muted);
}

.form-selection-modal-close:hover {
    color: var(--primary);
}

.form-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.form-selection-card {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(124, 58, 237, 0.05));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

body.dark-mode .form-selection-card {
    border-color: var(--border-dark);
}

.form-selection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
}

.form-selection-card h4 {
    color: var(--primary);
    margin-bottom: var(--space-2);
}

.form-selection-card p {
    font-size: var(--font-size-sm);
    color: var(--text-dark-muted);
}

body.dark-mode .form-selection-card p {
    color: var(--text-light-muted);
}

/* Form Selection Card - Blocked State (already submitted) */
.form-selection-card.blocked {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(192, 57, 43, 0.1));
    border-color: var(--error);
    cursor: not-allowed;
    opacity: 0.8;
}

.form-selection-card.blocked:hover {
    transform: none;
    box-shadow: none;
}

.form-selection-card.blocked h4 {
    color: var(--error);
}

.form-selection-card.blocked p {
    color: var(--error);
}

body.dark-mode .form-selection-card.blocked {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(192, 57, 43, 0.15));
}

/* Form Selection Card - Disabled State (form inactive) */
.form-selection-card.disabled {
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.1), rgba(100, 100, 100, 0.1));
    border-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-selection-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.form-selection-card.disabled h4 {
    color: var(--text-muted);
}

/* Need Login Modal */
.need-login-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.2s ease;
    padding: var(--space-4);
}

.need-login-modal-content {
    background: var(--bg-card-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-xl);
}

body.dark-mode .need-login-modal-content {
    background: var(--bg-card-dark);
}

.need-login-modal-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    font-size: 28px;
    color: var(--text-dark-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: var(--space-2);
    line-height: 1;
    transition: color var(--transition-fast);
    z-index: 10;
}

body.dark-mode .need-login-modal-close {
    color: var(--text-light-muted);
}

.need-login-modal-close:hover {
    color: var(--primary);
}

.need-login-modal-icon {
    font-size: 56px;
    margin-bottom: var(--space-4);
}

.need-login-modal-title {
    color: var(--primary);
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-4);
}

.need-login-modal-text {
    color: var(--text-dark);
    margin-bottom: var(--space-2);
}

body.dark-mode .need-login-modal-text {
    color: var(--text-light);
}

.need-login-modal-hint {
    font-size: var(--font-size-xs);
    color: var(--text-dark-muted);
    margin-bottom: var(--space-6);
}

body.dark-mode .need-login-modal-hint {
    color: var(--text-light-muted);
}

.need-login-modal .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

/* ===== MODAL SPECIFIC ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

body.dark-mode .modal-content {
    background: var(--bg-card-dark);
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    font-size: 28px;
    color: var(--text-dark-muted);
    cursor: pointer;
}

body.dark-mode .modal-close {
    color: var(--text-light-muted);
}

.modal-close:hover {
    color: var(--primary);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-6);
    text-align: center;
}

body.dark-mode .modal-title {
    color: var(--primary);
}

/* Modal Details Grid */
.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

.modal-detail-item {
    background: rgba(0, 0, 0, 0.02);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--primary);
}

body.dark-mode .modal-detail-item {
    background: rgba(255, 255, 255, 0.02);
}

.modal-detail-item strong {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-dark-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-1);
}

body.dark-mode .modal-detail-item strong {
    color: var(--text-light-muted);
}

.modal-detail-item span {
    font-size: var(--font-size-base);
    color: var(--text-dark);
}

body.dark-mode .modal-detail-item span {
    color: var(--text-light);
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-6);
    flex-wrap: wrap;
}

/* ===== CAROUSEL ACTIVE/INACTIVE ===== */
.carousel {
    display: none;
}

.carousel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===== CUSTOM NOTIFICATION ===== */
.custom-notification {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--error), #c0392b);
    color: white;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.3s ease;
}

/* ===== VOTERS SECTION ===== */
.voters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-1);
    margin-top: var(--space-3);
}

.voters img {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    border: 2px solid white;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.voters img:hover {
    transform: scale(1.3);
    z-index: 1;
}

/* ===== VOTE BUTTONS ===== */
.vote-buttons {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.vote-buttons button {
    flex: 1;
}

/* ===== FORCE BUTTONS ===== */
.force-buttons {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

/* ===== STAFF SELECTION ===== */
.staff-selection {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: center;
    margin-bottom: var(--space-6);
}

.staff-member {
    text-align: center;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.staff-member:hover {
    background: rgba(0, 217, 255, 0.1);
}

.staff-member.selected {
    background: rgba(0, 217, 255, 0.15);
}

.staff-member.selected img {
    box-shadow: 0 0 20px var(--primary-glow);
}

.staff-member img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-2);
    transition: box-shadow var(--transition-base);
}

.staff-member p {
    font-size: var(--font-size-sm);
    margin: 0;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.tab-button {
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-dark);
}

body.dark-mode .tab-button {
    border-color: var(--border-dark);
    color: var(--text-light);
}

.tab-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, var(--bg-dark-alt), var(--bg-dark));
    color: white;
    padding: var(--space-4) var(--space-6);
    box-shadow: var(--shadow-md);
}

body.light-mode header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-xl);
    margin: 0 auto;
}

.header-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-user img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-alt) 100%);
}

.login-form {
    background: var(--bg-card-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

body.dark-mode .login-form {
    background: var(--bg-card-dark);
}

.login-form h2 {
    color: var(--primary);
    margin-bottom: var(--space-6);
}

/* ===== THRESHOLD INFO ===== */
.threshold-info {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.7);
    margin: var(--space-2) 0 0;
}

/* ===== FORM EDITOR ===== */
.form-editor {
    display: none;
}

.form-editor.active {
    display: block;
}

.json-editor {
    display: none;
}

.json-editor.active {
    display: block;
}

.json-textarea {
    width: 100%;
    min-height: 300px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: var(--font-size-sm);
    padding: var(--space-4);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-input-light);
    color: var(--text-dark);
}

body.dark-mode .json-textarea {
    background: var(--bg-input-dark);
    border-color: var(--border-dark);
    color: var(--text-light);
}

/* Editor Tabs */
.editor-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.editor-tabs button {
    flex: 1;
}

/* Question List */
.questions-list {
    margin-top: var(--space-4);
}

.question-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}

body.dark-mode .question-item {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-dark);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.question-header h4 {
    margin: 0;
    color: var(--primary);
}

.question-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 640px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .modal-details {
        grid-template-columns: 1fr;
    }
    
    .form-selection-grid {
        grid-template-columns: 1fr;
    }
    
    .vote-buttons {
        flex-direction: column;
    }
    
    .login-form {
        padding: var(--space-6);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .theme-toggle,
    .staff-button,
    .search-bar,
    .carousel-buttons {
        display: none !important;
    }
}
