/* Global CSS for Checkpoint App */

/* CSS Variables for consistent theming */
:root {
    --primary-dark: #0A1128;
    --primary-light: #1a2332;
    --accent: #00E5FF;
    --accent-hover: #00d4e6;
    --success: #22c55e;
    --warning: #ffc107;
    --error: #ef4444;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-light: #f5f6fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Typography */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

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

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Button Reset */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

/* Link Styles */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

@media (min-width: 640px) {
    .grid-cols-sm-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .grid-cols-md-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-cols-md-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-cols-lg-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Card Component */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Button Component */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

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

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

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

.btn-success:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

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

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

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
}

/* Alert Component */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left-color: var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left-color: var(--error);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left-color: var(--warning);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left-color: var(--accent);
}

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

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

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-light);
}

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

@media (max-width: 768px) {
    th,
    td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    /* Stack table rows on mobile */
    .mobile-table {
        display: block;
    }

    .mobile-table thead {
        display: none;
    }

    .mobile-table tbody,
    .mobile-table tr,
    .mobile-table td {
        display: block;
        width: 100%;
    }

    .mobile-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.75rem;
    }

    .mobile-table td {
        text-align: left;
        padding: 0.5rem 0;
        border: none;
    }

    .mobile-table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        margin-right: 0.5rem;
        color: var(--text-secondary);
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

/* Hide/Show for Different Screen Sizes */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .show-mobile {
        display: none !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* Dark Mode Support (Future) */
@media (prefers-color-scheme: dark) {
    /* Ready for future dark mode implementation */
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Performance Optimization */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
