/* SGN Controls - Common Stylesheet */
/* Orange & Grey Theme with Dynamic Elements */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Orbitron:wght@400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors */
    --primary-orange: #FF8C00;
    --secondary-orange: #FFA500;
    --light-orange: #FFB347;
    --dark-orange: #FF7700;
    --accent-orange: #FF6600;
    --vibrant-orange: #FF4500;
    
    /* Grey Palette */
    --primary-grey: #4A4A4A;
    --secondary-grey: #6B6B6B;
    --light-grey: #E5E5E5;
    --dark-grey: #2A2A2A;
    --charcoal-grey: #1A1A1A;
    --medium-grey: #808080;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f5f5f5;
    --bg-dark: #1a1a1a;
    
    /* Gradients */
    --gradient-orange: linear-gradient(135deg, #FF8C00 0%, #FFA500 50%, #FF7700 100%);
    --gradient-orange-vertical: linear-gradient(180deg, #FF8C00 0%, #FFA500 100%);
    --gradient-grey: linear-gradient(135deg, #4A4A4A 0%, #6B6B6B 50%, #2A2A2A 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(255, 140, 0, 0.1) 0%, rgba(255, 165, 0, 0.05) 100%);
    --gradient-radial: radial-gradient(circle, rgba(255, 140, 0, 0.1) 0%, transparent 70%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-orange: 0 8px 32px rgba(255, 140, 0, 0.3);
    --shadow-orange-light: 0 4px 16px rgba(255, 140, 0, 0.2);
    --shadow-grey: 0 8px 32px rgba(74, 74, 74, 0.2);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 25px;
    --radius-round: 50px;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    
    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Poppins', sans-serif;
    --font-display: 'Orbitron', monospace;
    
    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* ===== RESET & BASE STYLES ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--primary-grey);
    background: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
    color: var(--dark-grey);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1.125rem, 2vw, 1.25rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.125rem); }

p {
    margin-bottom: var(--space-sm);
    font-size: 1.1rem;
    line-height: 1.7;
}

a {
    color: var(--primary-orange);
    text-decoration: none;
    transition: var(--transition-normal);
}

a:hover {
    color: var(--dark-orange);
}

/* ===== UTILITY CLASSES ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-orange); }
.text-secondary { color: var(--secondary-grey); }
.text-dark { color: var(--dark-grey); }
.text-white { color: white; }

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-orange { background: var(--gradient-orange); }
.bg-grey { background: var(--gradient-grey); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-orange { box-shadow: var(--shadow-orange); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-round); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== LOADING SCREEN ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--gradient-orange);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-sm);
}

.loader-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-display);
}

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

/* ===== NAVIGATION ===== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: var(--space-sm) 0;
    z-index: var(--z-fixed);
    transition: all var(--transition-normal);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

nav.scrolled {
    padding: var(--space-xs) 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-lg);
}

.logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    cursor: pointer;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-orange);
    transition: width var(--transition-normal);
}

.logo:hover::after {
    width: 100%;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--primary-grey);
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-xl);
    font-size: 1rem;
}

.nav-link:hover {
    color: var(--primary-orange);
    background: rgba(255, 140, 0, 0.1);
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-orange);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    color: var(--primary-orange);
    background: rgba(255, 140, 0, 0.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: var(--space-xs);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-grey);
    margin: 3px 0;
    transition: var(--transition-normal);
    border-radius: 2px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-round);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-orange);
    color: white;
    box-shadow: var(--shadow-orange);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 140, 0, 0.4);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-grey);
    border: 2px solid var(--primary-orange);
}

.btn-secondary:hover {
    background: var(--gradient-orange);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-orange);
}

.btn-outline {
    background: transparent;
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
}

.btn-outline:hover {
    background: var(--primary-orange);
    color: white;
}

.btn-ghost {
    background: rgba(255, 140, 0, 0.1);
    color: var(--primary-orange);
    border: 1px solid rgba(255, 140, 0, 0.3);
}

.btn-ghost:hover {
    background: var(--gradient-orange);
    color: white;
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.9rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.1rem;
}

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

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

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
    position: relative;
}

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

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--light-grey);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--light-grey);
    background: var(--bg-secondary);
}

.card-orange {
    border-top: 4px solid var(--primary-orange);
}

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

.card-orange:hover::before {
    transform: scaleX(1);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--dark-grey);
}

.form-control {
    width: 100%;
    padding: var(--space-sm);
    border: 2px solid var(--light-grey);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: all var(--transition-normal);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.form-control:invalid {
    border-color: #dc3545;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th,
.table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--light-grey);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--dark-grey);
}

.table tr:hover {
    background: rgba(255, 140, 0, 0.05);
}

.table-striped tr:nth-child(even) {
    background: var(--bg-secondary);
}

/* ===== ANIMATIONS ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    0% { opacity: 0; transform: translateY(-50px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

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

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* ===== PARTICLES BACKGROUND ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-orange);
    border-radius: 50%;
    opacity: 0.3;
    animation: floatParticle 15s infinite linear;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% {
        transform: translateY(-100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* ===== RIPPLE EFFECT ===== */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* ===== SECTION STYLES ===== */
.section {
    padding: var(--space-3xl) 0;
    position: relative;
}

.section-sm {
    padding: var(--space-2xl) 0;
}

.section-lg {
    padding: 8rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-display);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--secondary-grey);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== GRID SYSTEMS ===== */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-auto-sm {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-auto-lg {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* ===== FLEXBOX UTILITIES ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .container {
        padding: 0 var(--space-md);
    }
}

@media (max-width: 992px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    
    .section {
        padding: var(--space-2xl) 0;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: var(--space-lg);
        box-shadow: var(--shadow-lg);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .section {
        padding: var(--space-xl) 0;
    }
    
    .container {
        padding: 0 var(--space-sm);
    }
}

@media (max-width: 576px) {
    .nav-container {
        padding: 0 var(--space-sm);
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.9rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    * {
        color: black !important;
        background: white !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2a2a2a;
        --primary-grey: #e0e0e0;
        --secondary-grey: #b0b0b0;
        --dark-grey: #f0f0f0;
    }
    
    .card {
        background: var(--bg-secondary);
        color: var(--primary-grey);
    }
    
    .form-control {
        background: var(--bg-secondary);
        color: var(--primary-grey);
        border-color: var(--secondary-grey);
    }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-grey);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-orange);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-orange);
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(255, 140, 0, 0.2);
    color: var(--dark-grey);
}

::-moz-selection {
    background: rgba(255, 140, 0, 0.2);
    color: var(--dark-grey);
}
