/* 
 * Custom CSS for Ad Config Manager
 * Additional styling and enhancements
 */

/* Global Styles */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --light-bg: #f8f9fa;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --card-shadow-hover: 0 8px 20px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Utility Classes */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm-hover:hover {
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease;
}

.shadow-lg-hover:hover {
    box-shadow: var(--card-shadow-hover);
    transition: box-shadow 0.2s ease;
}

/* Custom Buttons */
.btn-gradient {
    background: var(--primary-gradient);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Card Enhancements */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

/* Badge Styles */
.badge-gradient {
    background: var(--primary-gradient);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Form Enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.input-group-text {
    background: #f7fafc;
    border-color: #e2e8f0;
}

/* Tooltip Styles */
.tooltip-custom {
    position: relative;
    display: inline-block;
}

.tooltip-custom .tooltip-text {
    visibility: hidden;
    background-color: #2d3748;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip-custom:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Alert Enhancements */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: 8px;
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: #f0fff4;
    color: #22543d;
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: #fff5f5;
    color: #742a2a;
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: #fffaf0;
    color: #7c2d12;
}

.alert-info {
    border-left-color: var(--info-color);
    background-color: #ebf8ff;
    color: #2c5282;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: var(--light-bg);
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    background: var(--light-bg);
    border-radius: 0 0 12px 12px;
}

/* Table Styles */
.table-custom {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table-custom thead {
    background: var(--primary-gradient);
    color: white;
}

.table-custom thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table-custom tbody tr:hover {
    background-color: #f7fafc;
}

/* Breadcrumb Styles */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
}

.breadcrumb-item.active {
    color: #718096;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .app-card {
        margin-bottom: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .action-buttons {
        display: none !important;
    }
    
    body {
        background: white;
    }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.focus-visible:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Code Block Styling (for JSON preview) */
.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-block::-webkit-scrollbar {
    height: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #81e6d9;
}

.json-string {
    color: #fbd38d;
}

.json-number {
    color: #90cdf4;
}

.json-boolean {
    color: #fc8181;
}

.json-null {
    color: #a0aec0;
}
