/*
Intelligent Construction Workflow - Main Stylesheet
Color scheme: Gradient background, dark cards, white text
*/

/* CSS Variables for color scheme */
:root {
    --bg-start: #0f5b73;
    --bg-end: #1581a3;
    --card-bg: #093442;
    --button-bg: #093442;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --border-color: rgba(255, 255, 255, 0.2);
    --shadow: rgba(0, 0, 0, 0.3);
    --hover-overlay: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
}

/* 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.5rem; }

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.container-fluid {
    padding: 2rem 3rem;
}

/* Navigation Bar */
.navbar {
    background: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px var(--shadow);
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.navbar-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.navbar-menu a:hover {
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-header {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

/* Metric Cards */
.metric-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

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

.metric-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.metric-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    background: var(--button-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: rgba(9, 52, 66, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, #1581a3 0%, #0f5b73 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a96bf 0%, #126888 100%);
}

.btn-success {
    background: #28a745;
    border: none;
}

.btn-danger {
    background: #dc3545;
    border: none;
}

.btn-warning {
    background: #ffc107;
    color: #000;
    border: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

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

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

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-control:focus {
    outline: none;
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

select.form-control {
    cursor: pointer;
}

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

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #000;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

.badge-primary {
    background: var(--button-bg);
    color: white;
}

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

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
    color: #a3e6b4;
}

.alert-error {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: #f5c2c7;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #fff3cd;
}

.alert-info {
    background: rgba(23, 162, 184, 0.2);
    border-color: #17a2b8;
    color: #b3e5fc;
}

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

.col {
    flex: 1;
    padding: 0 1rem;
}

.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Spacing Utilities */
.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; }

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

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

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

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

/* Display */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .col-3, .col-4, .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .navbar-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
}
