/* ============================================
   TylerCode - Global Styles
   ============================================ */

:root {
    --primary-color: #04aa6d;
    --primary-dark: #038a57;
    --secondary-color: #2196F3;
    --danger-color: #f44747;
    --success-color: #4ec9b0;
    --warning-color: #ffc107;
    --info-color: #569cd6;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --bg-light: #f5f5f5;
    --bg-lighter: #f9f9f9;
    --border-color: #ddd;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

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

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

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

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

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

section {
    padding: 60px 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

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

.card-body {
    padding: 15px 0;
}

.card-footer {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(4, 170, 109, 0.3);
}

.btn:active {
    transform: scale(0.98);
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-secondary {
    background: #666;
}

.btn-secondary:hover {
    background: #555;
}

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

.btn-danger:hover {
    background: #cc3636;
}

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

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

.btn-disabled,
.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Forms */
input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(4, 170, 109, 0.1);
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-error {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: var(--bg-lighter);
    font-weight: 600;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--bg-lighter);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(4, 170, 109, 0.2);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(78, 201, 176, 0.2);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ff9800;
}

.badge-danger {
    background: rgba(244, 71, 71, 0.2);
    color: var(--danger-color);
}

.badge-info {
    background: rgba(86, 156, 214, 0.2);
    color: var(--info-color);
}

/* Progress Bar */
.progress {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #dff0d8;
    color: #3c763d;
    border-left-color: var(--success-color);
}

.alert-danger {
    background: #f2dede;
    color: #a94442;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background: #fcf8e3;
    color: #8a6d3b;
    border-left-color: var(--warning-color);
}

.alert-info {
    background: #d9edf7;
    color: #31708f;
    border-left-color: var(--info-color);
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

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

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

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

/* Flexbox utilities */
.flex {
    display: flex;
}

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

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

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

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

/* Spacing */
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.pt-1 { padding-top: 10px; }
.pt-2 { padding-top: 20px; }
.pt-3 { padding-top: 30px; }

.pb-1 { padding-bottom: 10px; }
.pb-2 { padding-bottom: 20px; }
.pb-3 { padding-bottom: 30px; }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-info { color: var(--info-color); }

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

.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }

/* Lists */
ul, ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
}

/* Code */
code {
    background: var(--bg-lighter);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 20px;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Responsive */
@media (max-width: 768px) {
    section {
        padding: 40px 20px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }

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

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

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

    .btn {
        width: 100%;
        text-align: center;
    }

    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .no-print {
        display: none;
    }

    a {
        text-decoration: underline;
    }
}
