/* ===================================================================
   ULTRACIRCULUM HUB - UNIFIED MODAL SYSTEM
   Standardized modal styling for all popup forms
   Different colors per section, same structure
   =================================================================== */

/* ===================================================================
   BASE MODAL STYLES - SHARED ACROSS ALL MODALS
   =================================================================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Segoe UI", Arial, sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Container */
.modal-content {
    background-color: #1a1b1c;
    border-radius: 16px;
    padding: 35px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    font-family: "Segoe UI", Arial, sans-serif;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

/* Modal Header */
.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-title {
    color: #ffffff;
    font-size: 26px;
    font-weight: 600;
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", Arial, sans-serif;
}

.modal-close:hover,
.modal-close:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===================================================================
   FORM STYLING - SHARED ACROSS ALL MODAL FORMS
   =================================================================== */

/* Form Rows and Groups */
.modal-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-form-group {
    margin-bottom: 20px;
    flex: 1;
}

.modal-form-group label {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Form Inputs */
.modal-input,
.modal-textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-family: "Segoe UI", Arial, sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modal-input::placeholder,
.modal-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.modal-input:focus,
.modal-textarea:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--modal-accent-color, #ffffff);
    box-shadow: 0 0 0 2px rgba(var(--modal-accent-rgb), 0.2);
}

.modal-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Submit Buttons */
.modal-submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Segoe UI", Arial, sans-serif;
    margin-top: 10px;
    background-color: var(--modal-accent-color, #ffffff);
}

.modal-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--modal-accent-rgb), 0.3);
}

.modal-submit-btn:disabled {
    background-color: rgba(var(--modal-accent-rgb), 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===================================================================
   FILE UPLOAD AREA - STANDARDIZED
   =================================================================== */
.modal-file-upload-area {
    border: 2px dashed rgba(var(--modal-accent-rgb), 0.4);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    margin-bottom: 20px;
}

.modal-file-upload-area:hover {
    border-color: rgba(var(--modal-accent-rgb), 0.6);
    background-color: rgba(255, 255, 255, 0.08);
}

.modal-file-upload-area.dragover {
    border-color: var(--modal-accent-color);
    background-color: rgba(var(--modal-accent-rgb), 0.1);
}

.modal-upload-icon {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.7;
    color: var(--modal-accent-color);
}

.modal-upload-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.modal-upload-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

/* File Preview */
.modal-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-file-preview.hidden {
    display: none !important;
}

.modal-preview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-preview-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
}

.modal-preview-size {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.modal-remove-file {
    background: none;
    border: none;
    color: #ff8282;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-remove-file:hover {
    background-color: rgba(255, 130, 130, 0.2);
}

/* ===================================================================
   STATUS MESSAGES - STANDARDIZED
   =================================================================== */
.modal-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    font-family: "Segoe UI", Arial, sans-serif;
}

.modal-message.error {
    background-color: rgba(255, 130, 130, 0.15);
    border: 1px solid rgba(255, 130, 130, 0.4);
    color: #ff8282;
}

.modal-message.success {
    background-color: rgba(135, 230, 135, 0.15);
    border: 1px solid rgba(135, 230, 135, 0.4);
    color: #87e687;
}

.modal-message.warning {
    background-color: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffc107;
}

.modal-message.info {
    background-color: rgba(var(--modal-accent-rgb), 0.15);
    border: 1px solid rgba(var(--modal-accent-rgb), 0.4);
    color: var(--modal-accent-color);
}

/* ===================================================================
   SECTION-SPECIFIC COLOR SCHEMES
   =================================================================== */

/* Login Modal - Blue Theme */
.login-modal {
    --modal-accent-color: #87aaff;
    --modal-accent-rgb: 135, 170, 255;
}

.login-modal .modal-title {
    color: var(--modal-accent-color);
}

/* Register Modal - Coral/Orange Theme */
.register-modal {
    --modal-accent-color: #ff8c69;
    --modal-accent-rgb: 255, 140, 105;
}

.register-modal .modal-title {
    color: var(--modal-accent-color);
}

/* Contact Modal - Teal Theme */
.contact-modal {
    --modal-accent-color: #4ECDC4;
    --modal-accent-rgb: 78, 205, 196;
}

.contact-modal .modal-title {
    color: var(--modal-accent-color);
}

/* News Modal - Purple Theme (if needed) */
.news-modal {
    --modal-accent-color: #C299FF;
    --modal-accent-rgb: 194, 153, 255;
}

.news-modal .modal-title {
    color: var(--modal-accent-color);
}

/* Downloads Modal - Pink Theme (if needed) */
.downloads-modal {
    --modal-accent-color: #FF9BC7;
    --modal-accent-rgb: 255, 155, 199;
}

.downloads-modal .modal-title {
    color: var(--modal-accent-color);
}

/* Uploads Modal - Pink Theme (if needed) */
.uploads-modal {
    --modal-accent-color: #FF9BC7;
    --modal-accent-rgb: 255, 155, 199;
}

.uploads-modal .modal-title {
    color: var(--modal-accent-color);
}

/* ===================================================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZATIONS
   =================================================================== */

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .modal-content {
        padding: 30px;
        width: 85%;
    }

    .modal-form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .modal-content {
        padding: 25px 20px;
        margin: 20px;
        width: calc(100% - 40px);
        min-width: 280px;
    }

    .modal-title {
        font-size: 22px;
    }

    .modal-form-row {
        flex-direction: column;
        gap: 0;
    }

    .modal-file-upload-area {
        padding: 20px;
    }

    .modal-upload-icon {
        font-size: 32px;
    }

    .modal-upload-text {
        font-size: 13px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        padding: 20px;
        max-height: 95vh;
    }

    .modal-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .modal-file-upload-area {
        padding: 15px;
    }
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */
.hidden {
    display: none !important;
}

.modal-loading {
    opacity: 0.6;
    pointer-events: none;
}

.modal-loading .modal-submit-btn {
    position: relative;
}

.modal-loading .modal-submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}