/* Tekvante - Professional CSS */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #0ea5e9;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-size: 14px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Navigation */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--primary-dark) !important;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--bg-secondary);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Tools Section */
.tools-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Tool Cards */
.tool-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.tool-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tool-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tool-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.tool-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

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

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

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.feature-item {
    text-align: center;
    padding: 2rem 1rem;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

.feature-item h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 2rem;
}

.footer h5 {
    color: white;
    margin-bottom: 1rem;
}

.footer p {
    color: #94a3b8;
    margin-bottom: 0;
}

/* Form Controls */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-tertiary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
    outline: none;
}

/* Placeholder text styling for better visibility */
.form-control::placeholder {
    color: #ffffff !important;
    opacity: 0.8;
}

.form-control:focus::placeholder {
    color: var(--text-primary) !important;
    opacity: 0.8;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Pre and Code Elements */
pre {
    background: var(--dark-color);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow: auto;
    border: 1px solid var(--border-color);
}

code {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
}

/* Utility Classes */
.text-muted {
    color: var(--text-secondary) !important;
}

.bg-light {
    background-color: var(--bg-secondary) !important;
}

.border {
    border: 1px solid var(--border-color) !important;
}

.rounded {
    border-radius: 8px !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }
    
    .tool-card {
        margin-bottom: 1rem;
    }
    
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tool-icon {
        margin: 0 auto;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .tools-section {
        padding: 2rem 0;
    }
    
    .features-section {
        padding: 2rem 0;
    }
    
    .tool-card {
        padding: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }
    
    body {
        background-color: var(--bg-secondary);
    }
    
    .tool-card {
        background: var(--bg-primary);
    }
    
    .form-control {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Toaster Notification System */
.toaster-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.toaster-notification {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 10px;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    transition: all 0.3s ease;
}

.toaster-notification.success {
    border-left: 4px solid var(--success-color);
    background: #f0fdf4;
}

.toaster-notification.danger {
    border-left: 4px solid var(--danger-color);
    background: #fef2f2;
}

.toaster-notification.info {
    border-left: 4px solid var(--accent-color);
    background: #eff6ff;
}

.toaster-notification.warning {
    border-left: 4px solid var(--warning-color);
    background: #fffbeb;
}

.toaster-notification.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

.toaster-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.toaster-close:hover {
    opacity: 1;
}

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Dark mode adjustments for toaster */
@media (prefers-color-scheme: dark) {
    .toaster-notification {
        background: var(--bg-primary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .toaster-notification.success {
        background: #064e3b;
        color: #d1fae5;
    }
    
    .toaster-notification.danger {
        background: #7f1d1d;
        color: #fecaca;
    }
    
    .toaster-notification.info {
        background: #1e3a8a;
        color: #dbeafe;
    }
    
    .toaster-notification.warning {
        background: #92400e;
        color: #fed7aa;
    }
}

/* Copy Button Animation */
.copy-success {
    animation: copyPulse 0.6s ease;
}

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

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.3);
}

/* Tool-specific styling */
.tool-page {
    background: var(--bg-secondary);
    min-height: 100vh;
}

.tool-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header-page {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.tool-header-page h1 {
    margin-bottom: 0.5rem;
}

.tool-header-page p {
    margin-bottom: 0;
    font-size: 1.125rem;
}

.tool-content {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* JSON Formatter Specific Styling */
.json-input {
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    min-height: 800px !important;
    height: 800px !important;
    resize: vertical;
}

.json-output {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
    border: 2px solid #4a5568 !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    min-height: 800px !important;
    height: 800px !important;
    max-height: 800px !important;
    overflow: auto !important;
    margin: 0 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

.json-output:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* Prism.js Custom Theme Overrides for JSON */
.json-output .token.property,
.json-input .token.property {
    color: #ff79c6 !important; /* Pink for keys */
}

.json-output .token.string,
.json-input .token.string {
    color: #f1fa8c !important; /* Yellow for string values */
}

.json-output .token.number,
.json-input .token.number {
    color: #bd93f9 !important; /* Purple for numbers */
}

.json-output .token.boolean,
.json-input .token.boolean {
    color: #ff5555 !important; /* Red for booleans */
}

.json-output .token.null,
.json-input .token.null {
    color: #ff5555 !important; /* Red for null */
}

.json-output .token.punctuation,
.json-input .token.punctuation {
    color: #f8f8f2 !important; /* White for brackets, commas, etc. */
}

.json-output .token.operator,
.json-input .token.operator {
    color: #f8f8f2 !important; /* White for operators */
}

/* Dark mode adjustments for JSON output */
@media (prefers-color-scheme: dark) {
    .json-output {
        background: #1a202c !important;
        border-color: #4a5568 !important;
    }
}

/* Info Cards Styling for Tools */
.tool-content .card.border-0.shadow-sm {
    background: var(--bg-primary);
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.tool-content .card.border-0.shadow-sm:hover {
    box-shadow: var(--shadow-lg) !important;
    transform: translateY(-2px);
}

.tool-content .card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    border-bottom: 1px solid var(--primary-dark);
    padding: 1rem 1.5rem;
}

.tool-content .card-header h6 {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.tool-content .card-body {
    padding: 1.5rem;
    background: var(--bg-primary);
}

.tool-content .card-body h6.text-primary {
    color: var(--primary-color) !important;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.tool-content .card-body h6.text-primary:first-child {
    margin-top: 0;
}

.tool-content .card-body p.small.text-muted {
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tool-content .card-body ul.small.text-muted {
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
    line-height: 1.6;
    padding-left: 1.25rem;
}

.tool-content .card-body ul.small.text-muted li {
    margin-bottom: 0.5rem;
}

/* Dark mode adjustments for info cards */
@media (prefers-color-scheme: dark) {
    .tool-content .card.border-0.shadow-sm {
        background: var(--bg-primary);
        border-color: var(--border-color) !important;
    }
    
    .tool-content .card-body {
        background: var(--bg-primary);
    }
}

/* JWT JSON Output Styling */
.jwt-json-output {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    min-height: 120px;
    max-height: 300px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.jwt-json-output:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Prism.js custom theme overrides for JWT JSON output */
.jwt-json-output .token.property {
    color: #f92672 !important;
}

.jwt-json-output .token.string {
    color: #a6e22e !important;
}

.jwt-json-output .token.number {
    color: #ae81ff !important;
}

.jwt-json-output .token.boolean {
    color: #66d9ef !important;
}

.jwt-json-output .token.null {
    color: #66d9ef !important;
}

.jwt-json-output .token.punctuation {
    color: #f8f8f2 !important;
}

.jwt-json-output .token.operator {
    color: #f92672 !important;
}

/* Dark mode adjustments for JWT output */
@media (prefers-color-scheme: dark) {
    .jwt-json-output {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color);
    }
}

/* CSV JSON Output Styling */
.csv-json-output {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    min-height: 445px;
    max-height: 445px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.csv-json-output:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Prism.js custom theme overrides for CSV JSON output */
.csv-json-output .token.property {
    color: #f92672 !important;
}

.csv-json-output .token.string {
    color: #a6e22e !important;
}

.csv-json-output .token.number {
    color: #ae81ff !important;
}

.csv-json-output .token.boolean {
    color: #66d9ef !important;
}

.csv-json-output .token.null {
    color: #66d9ef !important;
}

.csv-json-output .token.punctuation {
    color: #f8f8f2 !important;
}

.csv-json-output .token.operator {
    color: #f92672 !important;
}

/* Dark mode adjustments for CSV JSON output */
@media (prefers-color-scheme: dark) {
    .csv-json-output {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color);
    }
}

/* Footer Styling */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    margin-top: auto;
}

.footer h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer p {
    color: var(--text-muted);
    line-height: 1.6;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer ul li a:hover {
    color: var(--primary-color);
}

.footer hr {
    border-color: var(--border-color);
    margin: 2rem 0 1rem;
}

/* Dark mode footer adjustments */
@media (prefers-color-scheme: dark) {
    .footer {
        background: var(--bg-secondary);
        border-top-color: var(--border-color);
    }
}
