/**
 * NASA Team Registration System - Modern CSS
 * Modern, responsive design with beautiful animations
 */

/* CSS Variables for theming */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --danger-gradient: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    --shadow-light: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-heavy: 0 8px 32px rgba(0,0,0,0.15);
    
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

/* Email Activation Status Animations */
.email-activation-status {
    position: relative;
    overflow: hidden;
}

.email-activation-status.checking {
    background: linear-gradient(90deg, #e3f2fd 0%, #f3e5f5 50%, #e3f2fd 100%);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.activation-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.activation-progress {
    overflow: hidden;
    position: relative;
}

.activation-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.member-status {
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 4px 0;
}

.member-status.activated {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    animation: slideIn 0.5s ease-out;
}

.member-status.pending {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
    animation: pulse 2s infinite;
}

.member-status.failed {
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
    border-left: 4px solid #dc3545;
    animation: shake 0.5s ease-out;
}

.member-status.checking {
    background: linear-gradient(135deg, #cce5ff 0%, #b3d9ff 100%);
    border-left: 4px solid #007bff;
    animation: checking 1.5s infinite;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes checking {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Form Elements Enhancement */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-size: 16px;
    transition: var(--transition);
    background: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: #fff;
}

.form-control.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.4.4.4-.4.4.4.4-.4.4.4L4.7 7.73l-.4-.4-.4.4-.4-.4-.4.4-.4-.4.4-.4.4.4.4-.4.4.4.4-.4-.4-.4-.4-.4-.4-.4-.4.4-.4.4.4-.4-.4-.4-.4.4-.4.4.4.4.4.4.4-.4.4.4.4-.4.4.4.4-.4-.4-.4-.4.4L2.7 6.3z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4M8.2 4.6l-2.4 2.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: #dc3545;
    font-weight: 700;
}

/* Button Enhancements */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-success {
    background: var(--success-gradient);
    border: none;
}

.btn-warning {
    background: var(--warning-gradient);
    border: none;
}

.btn-danger {
    background: var(--danger-gradient);
    border: none;
}

.btn-info {
    background: var(--info-gradient);
    border: none;
}

/* Card Enhancements */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.card-header {
    border-bottom: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Cards */
.section-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.section-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1.5rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Member Cards */
.member-card {
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin: 1.5rem 0;
    transition: var(--transition);
    position: relative;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.member-card:hover::before,
.member-card.filled::before {
    transform: scaleX(1);
}

.member-card.filled {
    border-style: solid;
    border-color: #28a745;
    background: rgba(248, 255, 249, 0.9);
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Add Member Button */
.add-member-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed #6c757d;
    color: #6c757d;
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    width: 100%;
    cursor: pointer;
}

.add-member-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.file-upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.file-upload-area.dragover {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    transform: scale(1.02);
}

.file-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.file-item:hover {
    background: rgba(248, 249, 250, 1);
    transform: translateX(5px);
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.progress-bar-custom {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-custom::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-20px); }
    100% { transform: translateX(20px); }
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-light);
    border-left: 4px solid;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #155724;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #856404;
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-left-color: #17a2b8;
    color: #0c5460;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-heavy);
    backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: none;
    padding: 2rem 2rem 1rem;
}

.modal-body {
    padding: 1rem 2rem;
}

.modal-footer {
    border-top: none;
    padding: 1rem 2rem 2rem;
}

/* Badge Enhancements */
.badge {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
}

/* Admin Specific Styles */
.sidebar {
    background: var(--primary-gradient);
    box-shadow: var(--shadow-medium);
    color: white;
}

.sidebar h4 {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.sidebar hr {
    border-color: rgba(255, 255, 255, 0.3);
}

.sidebar .small, .sidebar small {
    color: rgba(255, 255, 255, 0.8) !important;
}

.nav-link {
    border-radius: var(--border-radius);
    transition: var(--transition);
    margin: 0.25rem 0;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9) !important;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
    color: white !important;
}

.stats-card {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-5px) scale(1.02);
}

/* Sortable Field Styles */
.sortable-field {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 0.5rem 0;
    cursor: move;
    transition: var(--transition);
    position: relative;
}

.sortable-field::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.sortable-field:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.sortable-field:hover::before {
    transform: scaleY(1);
}

.sortable-field.sortable-chosen {
    transform: rotate(2deg) scale(1.05);
    opacity: 0.8;
    z-index: 1000;
}

.field-type-button {
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #dee2e6;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    border-radius: var(--border-radius);
    margin: 0.25rem;
    transition: var(--transition);
    color: #6c757d;
}

.field-type-button:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        border-radius: var(--border-radius);
    }
    
    .header-section {
        padding: 2rem 1rem;
    }
    
    .form-section {
        padding: 2rem 1rem;
    }
    
    .member-card {
        padding: 1.5rem;
    }
    
    .add-member-btn {
        padding: 2rem;
    }
    
    .file-upload-area {
        padding: 2rem 1rem;
    }
    
    .section-header {
        padding: 1rem;
    }
    
    .btn-group-sm .btn {
        font-size: 0.75rem;
    }
    
    .modal-content {
        margin: 1rem;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .member-card {
        margin: 1rem 0;
    }
    
    .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .field-type-button {
        margin: 0.125rem;
        padding: 1rem 0.5rem;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Apply animations */
.section-card {
    animation: fadeInUp 0.6s ease-out;
}

.member-card {
    animation: slideInLeft 0.5s ease-out;
}

.alert {
    animation: fadeInDown 0.4s ease-out;
}

/* Print Styles */
@media print {
    .sidebar,
    .btn,
    .progress-indicator {
        display: none !important;
    }
    
    .main-container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .section-card {
        break-inside: avoid;
        box-shadow: none;
    }
}