/* Main CSS for Squadron Almanac Frontend */

/* CSS Variables */
:root {
    --primary-color: #e1b23c;
    --primary-dark: #d4a532;
    --secondary-color: #00247d;
    --secondary-dark: #003a9e;
    --bg-dark: #1a1a1a;
    --bg-card: #242423;
    --bg-element: #343434;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --border-color: #e1b23c;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --info: #2196f3;
}

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

body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

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;
}

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

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

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

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 178, 60, 0.2);
}

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

.card-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card-body {
    color: var(--text-secondary);
}

.card-footer {
    border-top: 1px solid var(--bg-element);
    margin-top: 20px;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1;
}

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

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

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

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: #000;
}

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

.btn-secondary:hover {
    background: var(--primary-color);
    color: #000;
}

.btn-blue {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.btn-blue:hover {
    background: var(--secondary-dark);
    color: var(--text-primary);
}

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

.btn-success:hover {
    background: #45a049;
    color: var(--text-primary);
}

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

.btn-danger:hover {
    background: #da190b;
    color: var(--text-primary);
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-warning:hover {
    background: #e68900;
    color: #000;
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

.btn-block {
    display: block;
    width: 100%;
}

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

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

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    background: var(--bg-element);
    border: 2px solid transparent;
    border-radius: 4px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
}

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

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

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

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table thead {
    background: var(--bg-element);
}

.table th {
    padding: 15px;
    text-align: left;
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--bg-element);
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: var(--bg-element);
}

.table-striped tbody tr:nth-child(odd) {
    background: rgba(52, 52, 52, 0.3);
}

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

.badge-primary {
    background: var(--primary-color);
    color: #000;
}

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

.badge-danger {
    background: var(--error);
    color: var(--text-primary);
}

.badge-warning {
    background: var(--warning);
    color: #000;
}

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

.badge-secondary {
    background: var(--bg-element);
    color: var(--text-secondary);
}

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

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border-left-color: var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border-left-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-left-color: var(--info);
    color: var(--info);
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

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

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.text-warning { color: var(--warning); }

.bg-primary { background: var(--primary-color); }
.bg-secondary { background: var(--secondary-color); }
.bg-dark { background: var(--bg-dark); }
.bg-card { background: var(--bg-card); }

.mt-0 { margin-top: 0; }
.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-0 { margin-bottom: 0; }
.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; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }
.pt-5 { padding-top: 3rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }
.pb-5 { padding-bottom: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-element);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--bg-element);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--bg-element);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
}

@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }

    [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
}

@media (max-width: 576px) {
    .container,
    .container-fluid {
        padding: 0 10px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .card {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .header,
    .footer,
    .btn,
    .flash-messages {
        display: none;
    }

    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}
