/* Shodh-Memory Dashboard - Matching Website Design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Modern Color Palette - Matching Website */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #8b5cf6;
    --secondary-dark: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Backgrounds - Dark Theme */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-glass: rgba(15, 23, 42, 0.7);
    --bg-glass-light: rgba(30, 41, 59, 0.5);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-focus: rgba(59, 130, 246, 0.5);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.4);
    --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Gradient Mesh Background - Matching Website */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 0.15) 0px, transparent 50%),
        radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 0.12) 0px, transparent 50%),
        radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 0.15) 0px, transparent 50%),
        radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 0.12) 0px, transparent 50%),
        radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 0.15) 0px, transparent 50%),
        radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 0.12) 0px, transparent 50%),
        radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 0.15) 0px, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: gradient-shift 20s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Header - Enhanced */
header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xl);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fade-in 0.6s ease-out;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: var(--shadow-glow);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(2deg);
    }
    50% {
        transform: translateY(-20px) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

.logo-text h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-text .subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-glass-light);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.header-status:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Main Container */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem 4rem 2rem;
    animation: fade-in-up 0.6s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Cards - Enhanced Glass Effect */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow-purple);
}

.card h2, .card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.card h2 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card h3 {
    font-size: 1.25rem;
}

/* Form Elements - Enhanced */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
    font-size: 0.9375rem;
    letter-spacing: -0.2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--border-focus);
    background: var(--bg-tertiary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Buttons - Enhanced with Gradients */
button {
    padding: 1rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.2px;
}

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

button:hover::before {
    left: 100%;
}

button:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(59, 130, 246, 0.5);
}

button:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

button.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

button.secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

button.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Stats Grid - Enhanced */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

/* Results & Search Results */
#searchResults > div,
.result-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

#searchResults > div:hover,
.result-item:hover {
    border-color: var(--border-hover);
    transform: translateX(6px);
    box-shadow: var(--shadow-lg);
}

/* Console - Enhanced Terminal Look */
#console {
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.875rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.console-line {
    padding: 0.375rem 0;
    color: #0f0;
    line-height: 1.5;
}

/* Badges - Enhanced */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge.info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

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

/* API Documentation Styles */
.api-nav {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.api-nav-btn {
    padding: 0.875rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    letter-spacing: -0.2px;
}

.api-nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.api-nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.api-category {
    animation: fadeIn 0.3s ease;
}

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

.api-category h3 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-weight: 700;
}

.endpoint {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.endpoint:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.endpoint-header code {
    background: var(--bg-primary);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, monospace;
    flex: 1;
    min-width: 200px;
    font-weight: 600;
}

.method {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    min-width: 70px;
    justify-content: center;
}

.method.get {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 2px solid var(--success);
}

.method.post {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
    border: 2px solid var(--primary);
}

.method.put {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.method.delete {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.endpoint > p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.code-example {
    margin-top: 1.25rem;
}

.code-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.code-tab {
    padding: 0.625rem 1.25rem;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.code-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.code-tab.active {
    background: var(--bg-tertiary);
    color: var(--primary-light);
    border-bottom: 3px solid var(--primary);
}

.code-content {
    background: #0a0a0a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    overflow-x: auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.code-content code {
    font-family: 'SF Mono', Monaco, Menlo, monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #0f0;
    white-space: pre;
    display: block;
}

/* Code syntax highlighting */
.code-content.curl code {
    color: #06b6d4;
}

.code-content.python code {
    color: #10b981;
}

.code-content.json code {
    color: #f59e0b;
}

/* Scrollbar - Enhanced */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 1rem 2rem 1rem;
    }

    .api-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .endpoint-header code {
        width: 100%;
    }

    .card {
        padding: 1.5rem;
    }

    button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 1.5rem;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    header {
        padding: 1rem 1.5rem;
    }
}

/* Print Styles */
@media print {
    body::before {
        display: none;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
