/* Shared CSS for Techno Sutra AR Project
   Contains common styles used across multiple pages */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #7877c6;
    --primary-light: rgba(120, 119, 198, 0.2);
    --primary-dark: rgba(120, 119, 198, 0.8);
    --text-light: #e5e7eb;
    --text-muted: #9ca3af;
    --bg-dark: #000000;
    --bg-card: rgba(15, 15, 15, 0.8);
    --border-light: rgba(120, 119, 198, 0.1);
    --border-medium: rgba(120, 119, 198, 0.3);
    --border-strong: rgba(120, 119, 198, 0.5);
    --gradient-primary: linear-gradient(135deg, #7877c6 0%, #ffffff 100%);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(135deg, rgba(120, 119, 198, 0.2) 0%, rgba(120, 119, 198, 0.1) 100%);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 25px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(120, 119, 198, 0.25);
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.03) 0%, transparent 50%);
    min-height: 100vh;
    color: var(--text-light);
    letter-spacing: 0.025em;
    font-weight: 300;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

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

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* Loading Elements */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: var(--transition-normal);
}

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

.loading-content {
    text-align: center;
    color: white;
}

.loading-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.loading-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    display: none;
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 20px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition-normal);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    min-width: 60px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.mobile-nav-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.mobile-nav-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-nav-item.center {
    background: var(--gradient-card);
    border: 1px solid var(--border-medium);
    color: #ffffff;
    transform: scale(1.1);
}

.mobile-nav-item.center:hover {
    background: linear-gradient(135deg, rgba(120, 119, 198, 0.3) 0%, rgba(120, 119, 198, 0.2) 100%);
    border-color: var(--border-strong);
    transform: scale(1.15) translateY(-2px);
}

/* Offline Status Header */
.offline-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #000000;
    color: #00FF41; /* Matrix Green */
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    text-align: center;
    padding: 4px 0;
    z-index: 2000;
    display: none; /* Hidden by default */
    text-shadow: 0 0 5px #00FF41, 0 0 10px #00FF41;
    letter-spacing: 0.1em;
}

.offline-header.show {
    display: block;
}

/* Buttons and Controls */
.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-light);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    letter-spacing: 0.025em;
}

.action-btn:hover {
    background: var(--primary-light);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn.primary {
    background: var(--gradient-card);
    border-color: var(--border-strong);
    color: #ffffff;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, rgba(120, 119, 198, 0.3) 0%, rgba(120, 119, 198, 0.2) 100%);
    box-shadow: 0 6px 25px rgba(120, 119, 198, 0.2);
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(10, 10, 10, 0.5);
    border-color: rgba(120, 119, 198, 0.05);
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 15, 0.95);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    border: 1px solid var(--border-medium);
    backdrop-filter: blur(20px);
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border-medium);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Media Queries */
@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }
    
    body {
        padding-bottom: 80px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* PWA safe area adjustments */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-nav {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* Light Mode */
body.light-mode {
    background: #f8fafc;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(99, 102, 241, 0.02) 0%, transparent 50%);
    color: #1f2937;
}

body.light-mode .action-btn {
    background: rgba(255, 255, 255, 0.8);
    color: #1f2937;
    border-color: rgba(99, 102, 241, 0.2);
}

body.light-mode .action-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
}

body.light-mode .mobile-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(99, 102, 241, 0.1);
}

body.light-mode .mobile-nav-item {
    color: #6b7280;
}

body.light-mode .mobile-nav-item:hover,
body.light-mode .mobile-nav-item.active {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.1);
}