/* ===================================================================
   MOTOR CITY 3D - SHARED CSS
   Universal styles for all frontend pages
   =================================================================== */

/* Typography & Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color System */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-secondary: #818cf8;
    --color-accent: #3b82f6;
    
    /* Background Colors */
    --bg-primary: #111827;        /* gray-900 */
    --bg-secondary: #1f2937;      /* gray-800 */
    --bg-tertiary: #374151;       /* gray-700 */
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;    /* gray-300 */
    --text-tertiary: #9ca3af;     /* gray-400 */
    
    /* Border Colors */
    --border-primary: #4b5563;    /* gray-600 */
    --border-secondary: #374151;  /* gray-700 */
    
    /* Status Colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-red: #dc2626;
    --color-red-hover: #b91c1c;
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    overscroll-behavior: none;
}

/* ===================================================================
   LAYOUT COMPONENTS
   =================================================================== */

.generator-layout {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

@media (min-width: 768px) {
    .generator-layout {
        flex-direction: row;
    }
}

.control-panel {
    width: 100%;
    background-color: var(--bg-secondary);
    height: 100%;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .control-panel {
        width: 24rem; /* w-96 */
    }
}

.viewer-container {
    flex: 1;
    position: relative;
}

/* Scrolling Areas */
.scrolling-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
}

.scrolling-area::-webkit-scrollbar {
    width: 8px;
}

.scrolling-area::-webkit-scrollbar-track {
    background: #2d3748;
}

.scrolling-area::-webkit-scrollbar-thumb {
    background-color: #4a5568;
    border-radius: 4px;
}

.scrolling-area::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}

/* ===================================================================
   FORM COMPONENTS
   =================================================================== */

/* Form Inputs */
.form-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-input:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

/* Select Inputs */
.form-select {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    color: var(--text-primary);
}

.form-select:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--color-secondary);
}

/* Range Slider Styles */
input[type="range"] {
    width: 100%;
    height: 0.5rem;
    background-color: var(--bg-tertiary);
    border-radius: 0.5rem;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-secondary);
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--color-secondary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Color Input Styles */
input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
}

/* Checkbox Styles */
input[type="checkbox"] {
    height: 1rem;
    width: 1rem;
    border-radius: 0.25rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--color-secondary);
}

/* Array Input (for generators) */
.array-input {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    width: 100%;
}

/* ===================================================================
   BUTTON COMPONENTS
   =================================================================== */

/* Primary Button */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--text-primary);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

/* Payment Button */
.btn-payment {
    width: 100%;
    background-color: var(--color-primary);
    color: var(--text-primary);
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

.btn-payment:hover {
    background-color: var(--color-primary-hover);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--border-primary);
}

/* Success Button */
.btn-success {
    background-color: var(--color-success);
    color: var(--text-primary);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.btn-success:hover {
    background-color: #059669;
}

/* Logout Button */
.btn-logout {
    background-color: var(--color-red);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.btn-logout:hover {
    background-color: var(--color-red-hover);
}

/* ===================================================================
   LAYOUT COMPONENTS
   =================================================================== */

/* Panel Styles */
.panel {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

/* Card Styles */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2), 0 4px 6px -2px rgba(99, 102, 241, 0.1);
}

/* Code Viewer */
.code-viewer {
    max-height: 400px;
    background-color: var(--bg-primary);
    border-radius: 0.375rem;
    padding: 0.75rem;
    overflow: auto;
}

.code-viewer pre {
    margin: 0;
}

.code-viewer code {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* ===================================================================
   AUTHENTICATION COMPONENTS
   =================================================================== */

/* Auth Header */
.auth-header-container {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-secondary);
    padding: 0.5rem 0;
}

.auth-nav-link {
    color: #a5b4fc;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.auth-nav-link:hover {
    color: #c7d2fe;
}

/* ===================================================================
   LOADING & ANIMATIONS
   =================================================================== */

/* Loading Spinner */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-secondary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(17, 24, 39, 0.75);
    z-index: 20;
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */

/* Typography */
.heading-primary {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #a5b4fc;
}

.heading-secondary {
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.text-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #c7d2fe;
    float: right;
}

/* Spacing */
.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

/* Grid Layouts */
.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.col-span-2 {
    grid-column: span 2 / span 2;
}

/* Flexbox utilities removed - using Tailwind CSS classes */

/* Border Utilities */
.border-t {
    border-top: 1px solid var(--border-primary);
}

.border-b {
    border-bottom: 1px solid var(--border-primary);
}

/* Positioning */
.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

.fixed {
    position: fixed;
}

.top-0 {
    top: 0px;
}

.left-0 {
    left: 0px;
}

.right-0 {
    right: 0px;
}

.z-50 {
    z-index: 50;
}

.z-20 {
    z-index: 20;
}

/* Display utilities removed - using Tailwind CSS classes */

/* Grid and block utilities removed - using Tailwind CSS classes */

/* Alignment utilities removed - using Tailwind CSS classes */

/* Sizing */
.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.h-screen {
    height: 100vh;
}

/* Margins & Padding */
.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.pt-4 {
    padding-top: 1rem;
}

/* Overflow */
.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.overflow-auto {
    overflow: auto;
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */

@media (min-width: 640px) {
    .sm\:text-lg {
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) {
    .md\:flex-row {
        flex-direction: row;
    }
    
    .md\:w-96 {
        width: 24rem;
    }
    
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ===================================================================
   UNIFIED MENU COMPONENT STYLES
   =================================================================== */

/* Hamburger Icon Animation */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 18px;
    cursor: pointer;
}

.hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #d1d5db;
    border-radius: 1px;
    transition: all 0.3s ease-in-out;
}

.hamburger-icon.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-icon.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-icon.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Enhanced Mobile Menu */
#mobileMenu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: #1f2937;
    border-left: 1px solid #374151;
    z-index: 50;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

#mobileMenu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #374151;
    background-color: #111827;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease-in-out;
}

.mobile-menu-close:hover {
    background-color: #374151;
    color: #ffffff;
}

.mobile-menu-content {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.mobile-menu-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #d1d5db;
    text-decoration: none;
    border-bottom: 1px solid #374151;
    transition: all 0.2s ease-in-out;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
    background-color: #374151;
    color: #ffffff;
    padding-left: 1.5rem;
}

.mobile-auth-info {
    border-top: 1px solid #374151;
    margin-top: 1rem;
    padding-top: 1rem;
}

.mobile-auth-info .text-gray-400 {
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #374151;
}

.mobile-auth-info .mobile-menu-link {
    border-bottom: none;
}

/* Desktop menu responsive hiding */
@media (max-width: 767px) {
    .desktop-auth-only {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Ensure desktop menu is visible on large screens */
@media (min-width: 768px) {
    .hidden.md\:flex {
        display: flex !important;
    }
    
    /* Force desktop navigation to be visible */
    header .hidden.md\:flex {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}