@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    /* "Badass" AI-First Theme */
    /* Core Identity */
    --color-primary: #FF4500; /* Electric Orange */
    --color-primary-dark: #CC3700;
    --color-primary-light: #FF6A33;
    
    /* Tech Accents */
    --color-accent-cyan: #00E5FF;
    --color-accent-purple: #D500F9;
    
    /* Deep Dark Backgrounds */
    --color-background: #050505; /* Void Black */
    --color-background-light: #121212; /* Surface */
    --color-background-lighter: #1E1E1E; /* Elevated Surface */
    --color-border: #333333;
    
    /* Text */
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #A0A0A0;
    --color-text-muted: #666666;
    
    /* States */
    --color-success: #00E676;
    --color-error: #FF1744;
    --color-warning: #FFC400;

    /* RGB Values for Tailwind Opacity Support */
    --color-primary-rgb: 255, 69, 0;
    --color-primary-dark-rgb: 204, 55, 0; /* Added for Tailwind opacity support */
    --color-background-rgb: 5, 5, 5;
    --color-background-light-rgb: 18, 18, 18;
}

/* Base Styles */
body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.2); }
    50% { box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.5); }
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* AI Motif Background - Global subtle noise */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% 50%, rgba(var(--color-primary-rgb), 0.05) 0%, transparent 50%),
        linear-gradient(rgba(var(--color-background-rgb), 0.95), rgba(var(--color-background-rgb), 0.95)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23333' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
    animation: ai-background-pulse 6s infinite ease-in-out alternate;
}

/* =========================================
   SVG Background Patterns (The Art)
   ========================================= */

/* 1. Hex Tech (For Main Engines) */
.bg-hex-tech {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23FF4500' fill-opacity='0.05' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 2. Circuit Board (For AI Logic/Tech) */
.bg-circuit-board {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23FF4500' fill-opacity='0.08'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 3. Isometric Grid (For Infrastructure) */
.bg-grid-isometric {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40' stroke='%23333333' stroke-width='1' fill='none' opacity='0.4'/%3E%3C/svg%3E");
}

/* 4. Dot Matrix (For Data/Audit) */
.bg-dot-matrix {
    background-color: transparent;
    background-image: radial-gradient(rgba(255, 69, 0, 0.15) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Component Overrides & Custom Classes */

/* Buttons */
.cta-button, .cta-button-hero, .cta-button-secondary {
    @apply inline-flex items-center justify-center font-bold transition-all duration-300 rounded uppercase tracking-wider;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.cta-button:hover, .cta-button-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.6);
    border-color: var(--color-primary-light);
}

.cta-button-secondary {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.cta-button-secondary:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.4);
    color: white;
}

/* Cards */
.service-card, .pricing-card, .content-section {
    background-color: var(--color-background-light);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
}

.service-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

/* Inputs & Forms */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"], textarea, select {
    @apply bg-black/40 border border-gray-800 text-white rounded-lg px-4 py-3 placeholder-gray-600 focus:outline-none focus:border-primary-500/50 focus:ring-4 focus:ring-primary-500/10 transition-all duration-300 text-sm font-sans backdrop-blur-sm;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

input[type="checkbox"], input[type="radio"] {
    @apply h-5 w-5 bg-black/40 border border-gray-800 rounded text-primary-600 focus:ring-primary-500/50 focus:ring-offset-gray-900 transition-all duration-300 cursor-pointer backdrop-blur-sm;
}

input[type="radio"] {
    @apply rounded-full;
}

/* Hero Text */
.hero h1 {
    background: linear-gradient(to right, #fff, #a0a0a0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}

/* Navigation */
.app-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(var(--color-background-rgb), 0.8);
    backdrop-filter: blur(12px);
}

.app-header a {
    @apply text-sm uppercase tracking-widest font-semibold;
    color: var(--color-text-secondary);
}

.app-header a:hover, .app-header a.active {
    color: var(--color-primary);
}

/* Footer */
.app-footer {
    background-color: var(--color-background-light);
    border-top: 1px solid var(--color-border);
}

/* Utilities */
.text-primary-500 { color: var(--color-primary) !important; }
.bg-primary-600 { background-color: var(--color-primary) !important; }
.hover\:bg-primary-700:hover { background-color: var(--color-primary-dark) !important; }
.border-primary-500 { border-color: var(--color-primary) !important; }
.focus\:ring-primary-500:focus { --tw-ring-color: var(--color-primary) !important; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-background);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--color-primary-rgb), 0.5);
}

.shadow-glow-primary {
    box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.3);
}

.terminal-card {
    @apply bg-gray-900/50 border border-gray-800 rounded-lg overflow-hidden backdrop-blur-sm;
}

.terminal-header {
    @apply bg-gray-900 border-b border-gray-800 px-4 py-2 text-[10px] uppercase tracking-[0.2em] font-bold text-gray-500 flex items-center justify-between;
}

.terminal-header::before {
    content: "● ● ●";
    @apply text-[8px] tracking-normal mr-3 opacity-30;
}
/* =========================================
   Standardized UI Components (FND-008)
   ========================================= */

/* Buttons */
.btn {
    @apply inline-flex items-center justify-center px-6 py-3 text-sm font-bold uppercase tracking-widest transition-all duration-300 rounded focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-900;
}

.btn-primary {
    @apply bg-primary-600 text-white hover:bg-primary-700 focus:ring-primary-500 shadow-[0_0_15px_rgba(255,69,0,0.3)] hover:shadow-[0_0_25px_rgba(255,69,0,0.5)];
}

.btn-secondary {
    @apply bg-transparent border border-gray-600 text-gray-300 hover:border-white hover:text-white focus:ring-gray-500;
}

.btn-danger {
    @apply bg-red-900/20 border border-red-500/50 text-red-400 hover:bg-red-900/40 hover:text-red-300 focus:ring-red-500;
}

.btn-ghost {
    @apply bg-transparent text-gray-400 hover:text-white hover:bg-white/5;
}

.btn-sm {
    @apply px-4 py-2 text-xs;
}

.btn-lg {
    @apply px-8 py-4 text-base;
}

/* Inputs & Forms */
.form-group {
    @apply mb-6;
}

.form-label {
    @apply block text-xs font-bold text-gray-400 uppercase tracking-wider mb-2;
}

.form-input {
    @apply w-full bg-black/40 border border-gray-800 text-white rounded-lg px-4 py-3 placeholder-gray-600 focus:outline-none focus:border-primary-500/50 focus:ring-4 focus:ring-primary-500/10 transition-all duration-300 text-sm font-sans backdrop-blur-sm;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.form-textarea {
    @apply w-full bg-black/40 border border-gray-800 text-white rounded-lg px-4 py-3 placeholder-gray-600 focus:outline-none focus:border-primary-500/50 focus:ring-4 focus:ring-primary-500/10 transition-all duration-300 text-sm font-sans backdrop-blur-sm min-h-[120px];
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.form-select {
    @apply w-full bg-black/40 border border-gray-800 text-white rounded-lg px-4 py-3 focus:outline-none focus:border-primary-500/50 focus:ring-4 focus:ring-primary-500/10 transition-all duration-300 text-sm appearance-none backdrop-blur-sm;
    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 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.form-checkbox {
    @apply h-5 w-5 bg-black/40 border border-gray-800 rounded text-primary-600 focus:ring-primary-500/50 focus:ring-offset-gray-900 transition-all duration-300 cursor-pointer backdrop-blur-sm;
}

.form-radio {
    @apply h-5 w-5 bg-black/40 border border-gray-800 rounded-full text-primary-600 focus:ring-primary-500/50 focus:ring-offset-gray-900 transition-all duration-300 cursor-pointer backdrop-blur-sm;
}

.terminal-input {
    @apply w-full bg-black/60 border border-gray-800 text-gray-300 rounded px-4 py-2 placeholder-gray-700 focus:outline-none focus:border-primary-500/50 focus:ring-2 focus:ring-primary-500/10 transition-all duration-300 text-sm font-mono;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.7);
}

/* Cards */
.card {
    @apply bg-gray-900 border border-gray-800 rounded-xl p-8 relative overflow-hidden;
}

.card-hover {
    @apply transition-colors duration-300 hover:border-gray-700;
}

.card-header {
    @apply mb-6 pb-6 border-b border-gray-800;
}

.card-title {
    @apply text-xl font-bold text-white uppercase tracking-wide;
}

/* Badges */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded text-xs font-bold uppercase tracking-wider border;
}

.badge-primary {
    @apply bg-primary-500/10 text-primary-500 border-primary-500/20;
}

.badge-success {
    @apply bg-green-500/10 text-green-500 border-green-500/20;
}

.badge-warning {
    @apply bg-yellow-500/10 text-yellow-500 border-yellow-500/20;
}

.badge-error {
    @apply bg-red-500/10 text-red-500 border-red-500/20;
}

/* =========================================
   Visual Feedback & Animations (FND-013)
   ========================================= */

/* Loading Spinner */
.spinner {
    @apply animate-spin rounded-full border-2 border-current border-t-transparent h-4 w-4;
}

.spinner-lg {
    @apply h-8 w-8 border-4;
}

/* Button Loading State */
.btn-loading {
    @apply opacity-75 cursor-not-allowed relative text-transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1em;
    height: 1em;
    margin-top: -0.5em;
    margin-left: -0.5em;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    border-top-color: transparent;
}

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

/* Skeleton Loading (Shimmer) */
.skeleton {
    @apply bg-gray-800 rounded relative overflow-hidden;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* Skeleton Text Lines */
.skeleton-text {
    @apply h-4 w-3/4 mb-2;
}

.skeleton-text-sm {
    @apply h-3 w-1/2 mb-2;
}

.skeleton-block {
    @apply h-32 w-full mb-4;
}

/* Fade In Animation */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

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