/* ========================================
   Modern Base Styling - Unified Design System
   ======================================== */

/* ========== Color Variables ==========*/
:root {
    --primary: #000000;
    --primary-dark: #1a1a1a;
    --secondary: #ffffff;
    --accent: #666666;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --text-primary: #000000;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f7;
    --bg-tertiary: #f0f0f0;
    --bg-light: #fafafa;
    
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --sidebar-width: 240px;
    --sidebar-mobile-width: min(90vw, 300px);
    --navbar-height: 72px;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px 0 rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 8px 24px 0 rgba(0, 0, 0, 0.14);
    --shadow-2xl: 0 12px 32px 0 rgba(0, 0, 0, 0.16);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

body.sidebar-open {
    overflow: hidden;
}

/* ========== Typography ==========*/
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    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 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ========== Buttons ==========*/
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #000000;
    color: white;
    border-color: #000000;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: #1a1a1a;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-light);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.125rem;
}

/* ========== Forms ==========*/
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
    background: var(--bg-primary);
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

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

.form-group.checkbox {
    flex-direction: row;
    align-items: center;
    margin-bottom: 1rem;
}

.form-group.checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-group.checkbox label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.form-error {
    background: #fee2e2;
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--error);
    font-size: 0.95rem;
}

.form-success {
    background: #dcfce7;
    color: var(--success);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--success);
    font-size: 0.95rem;
}

/* ========== Cards ==========*/
.card {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* ========== Jumbotron ==========*/
.jumbotron {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 48px 32px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
}

/* ========== Containers ==========*/
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 896px;
}

.container-lg {
    max-width: 1200px;
}

.container-xl {
    max-width: 1400px;
}

/* ========== Grid & Layout ==========*/
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flex {
    display: flex;
    gap: 16px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* ========== Spacing ==========*/
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.px-2 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-4 { padding-left: 2rem; padding-right: 2rem; }

.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }

/* ========== Utilities ==========*/
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.text-primary {
    color: var(--primary);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

/* ========== Navigation ==========*/
.navbar {
    background: var(--bg-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* ========== Badges ==========*/
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--primary);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* ========== Alerts ==========*/
.alert {
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid;
    margin-bottom: 1.5rem;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success);
    color: #15803d;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: #92400e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: #7f1d1d;
}

/* ========== Loading & Animation ==========*/
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

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

.animate-bounce {
    animation: bounce 0.6s ease-in-out;
}

.animate-fade-in {
    animation: fade-in 0.3s ease-in;
}

.animate-slide-up {
    animation: slide-up 0.4s ease;
}

/* ========== Responsive ==========*/
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
    }

    .container {
        padding: 0 16px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .flex {
        flex-direction: column;
    }

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

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }

    .btn {
        width: 100%;
    }

    .navbar {
        padding: 12px;
    }
}
