/* Tesla-inspired Design System for VG Portal */

/* ============================================
   TESLA DESIGN SYSTEM COLORS
   ============================================ */
:root {
    /* Primary Tesla Colors */
    --tesla-red: #e31937;
    --tesla-blue: #3b82f6;
    --tesla-gray: #393c41;
    --tesla-white: #ffffff;
    --tesla-light-gray: #f8f9fa;
    --tesla-border: #e5e7eb;
    --tesla-text: #1f2937;
    --tesla-text-muted: #6b7280;
    
    /* Status Colors */
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-info: #3b82f6;
    
    /* Shadows */
    --tesla-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    --tesla-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.08);
    --tesla-shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.12);
    
    /* Radius */
    --tesla-radius: 0.25rem;
    --tesla-radius-lg: 0.5rem;
    
    /* Transitions */
    --tesla-transition: all 0.2s ease;
}

/* ============================================
   BASE COMPONENTS
   ============================================ */

/* Cards */
.tesla-card {
    background: var(--tesla-white);
    border: 1px solid var(--tesla-border);
    border-radius: var(--tesla-radius-lg);
    box-shadow: var(--tesla-shadow);
    transition: var(--tesla-transition);
    overflow: hidden;
}

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

.tesla-card-header {
    background: var(--tesla-white);
    border-bottom: 1px solid var(--tesla-border);
    padding: 1.5rem;
}

.tesla-card-title {
    color: var(--tesla-gray);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.tesla-card-body {
    padding: 1.5rem;
}

/* Buttons */
.tesla-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--tesla-radius);
    border: 1px solid transparent;
    transition: var(--tesla-transition);
    cursor: pointer;
    text-decoration: none;
}

.tesla-btn:hover {
    transform: translateY(-1px);
}

.tesla-btn:active {
    transform: translateY(0);
}

.tesla-btn-primary {
    background: var(--tesla-red);
    color: var(--tesla-white);
    border-color: var(--tesla-red);
}

.tesla-btn-primary:hover {
    background: #c41530;
    border-color: #c41530;
    box-shadow: var(--tesla-shadow);
}

.tesla-btn-secondary {
    background: var(--tesla-white);
    color: var(--tesla-gray);
    border-color: var(--tesla-border);
}

.tesla-btn-secondary:hover {
    background: var(--tesla-light-gray);
    border-color: #d1d5db;
}

.tesla-btn-ghost {
    background: transparent;
    color: var(--tesla-gray);
    border-color: transparent;
}

.tesla-btn-ghost:hover {
    background: var(--tesla-light-gray);
}

.tesla-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.tesla-btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Forms */
.tesla-form-group {
    margin-bottom: 1rem;
}

.tesla-form-label {
    display: block;
    color: var(--tesla-text);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.tesla-form-input,
.tesla-form-select,
.tesla-form-textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--tesla-gray);
    background: var(--tesla-white);
    border: 1px solid var(--tesla-border);
    border-radius: var(--tesla-radius);
    transition: var(--tesla-transition);
}

.tesla-form-input:hover,
.tesla-form-select:hover,
.tesla-form-textarea:hover {
    border-color: #c6cbd1;
}

.tesla-form-input:focus,
.tesla-form-select:focus,
.tesla-form-textarea:focus {
    outline: none;
    border-color: var(--tesla-red);
    box-shadow: 0 0 0 3px rgba(227, 25, 55, 0.1);
}

.tesla-form-error {
    color: var(--status-danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.tesla-form-hint {
    color: var(--tesla-text-muted);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Tables */
.tesla-table {
    width: 100%;
    background: var(--tesla-white);
    border-radius: var(--tesla-radius-lg);
    overflow: hidden;
    box-shadow: var(--tesla-shadow);
}

.tesla-table thead {
    background: var(--tesla-light-gray);
}

.tesla-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tesla-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--tesla-border);
}

.tesla-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--tesla-text);
    border-bottom: 1px solid var(--tesla-border);
}

.tesla-table tbody tr:last-child td {
    border-bottom: none;
}

.tesla-table tbody tr:hover {
    background: var(--tesla-light-gray);
}

/* Badges */
.tesla-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 9999px;
}

.tesla-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
}

.tesla-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-warning);
}

.tesla-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-danger);
}

.tesla-badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-info);
}

/* Alerts */
.tesla-alert {
    padding: 1rem;
    border-radius: var(--tesla-radius);
    margin-bottom: 1rem;
}

.tesla-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tesla-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.tesla-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.tesla-alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ============================================
   VG PORTAL SPECIFIC COMPONENTS
   ============================================ */

/* Stat Cards */
.vg-stat-card {
    background: var(--tesla-white);
    border: 1px solid var(--tesla-border);
    border-radius: var(--tesla-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--tesla-shadow);
    transition: var(--tesla-transition);
}

.vg-stat-card:hover {
    box-shadow: var(--tesla-shadow-hover);
    transform: translateY(-2px);
}

.vg-stat-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--tesla-radius);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.vg-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--tesla-gray);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.vg-stat-label {
    font-size: 0.875rem;
    color: var(--tesla-text-muted);
}

/* Module Cards */
.vg-module-card {
    display: block;
    padding: 2rem;
    text-align: center;
    background: var(--tesla-white);
    border: 1px solid var(--tesla-border);
    border-radius: var(--tesla-radius-lg);
    transition: var(--tesla-transition);
    text-decoration: none;
    color: inherit;
}

.vg-module-card:hover {
    box-shadow: var(--tesla-shadow-hover);
    transform: translateY(-2px);
    border-color: var(--tesla-red);
}

.vg-module-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.vg-module-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tesla-gray);
    margin-bottom: 0.5rem;
}

.vg-module-desc {
    font-size: 0.875rem;
    color: var(--tesla-text-muted);
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

.status-dot-success {
    background: var(--status-success);
}

.status-dot-warning {
    background: var(--status-warning);
}

.status-dot-danger {
    background: var(--status-danger);
}

.status-dot-info {
    background: var(--status-info);
}

/* Drag & Drop Zone */
.vg-dropzone {
    border: 2px dashed var(--tesla-border);
    border-radius: var(--tesla-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--tesla-light-gray);
    transition: var(--tesla-transition);
    cursor: pointer;
}

.vg-dropzone:hover {
    border-color: var(--tesla-red);
    background: rgba(227, 25, 55, 0.05);
}

.vg-dropzone.active {
    border-color: var(--tesla-red);
    background: rgba(227, 25, 55, 0.1);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes tesla-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.tesla-animate-fade {
    animation: tesla-fade-in 0.3s ease-out;
}

.tesla-animate-spin {
    animation: tesla-spin 1s linear infinite;
}

/* Loading Spinner */
.tesla-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--tesla-border);
    border-top-color: var(--tesla-red);
    border-radius: 50%;
    animation: tesla-spin 0.8s linear infinite;
}

/* ============================================
   UTILITIES
   ============================================ */

.tesla-shadow {
    box-shadow: var(--tesla-shadow);
}

.tesla-shadow-hover {
    box-shadow: var(--tesla-shadow-hover);
}

.tesla-shadow-lg {
    box-shadow: var(--tesla-shadow-lg);
}

.tesla-rounded {
    border-radius: var(--tesla-radius);
}

.tesla-rounded-lg {
    border-radius: var(--tesla-radius-lg);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .tesla-card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
    
    .tesla-table {
        font-size: 0.8125rem;
    }
    
    .tesla-table th,
    .tesla-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .vg-module-card {
        padding: 1.5rem;
    }
    
    .vg-module-icon {
        font-size: 2.5rem;
    }
}

/* ============================================
   DARK MODE SUPPORT (Future)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Dark mode variables can be added here */
}