/* CSS Custom Properties */
:root {
    --primary: #1a2744;
    --primary-light: #2a3f6b;
    --primary-lighter: #3a5a8f;
    --accent: #e8651a;
    --accent-hover: #d15a15;
    --accent-light: #f0a850;
    --bg: #f4f6f9;
    --bg-light: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --success: #27ae60;
    --info: #3498db;
    --warning: #e67e22;
    --danger: #e74c3c;
    --secondary: #95a5a6;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

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

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

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

/* Navbar */
.navbar {
    background-color: var(--primary);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.1em;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--accent);
    text-decoration: none;
    border-bottom-color: var(--accent);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 1rem;
}

.user-name {
    color: white;
    font-weight: 500;
}

.logout-btn {
    background-color: var(--accent);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background-color: var(--accent-hover);
    border-bottom: none;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    margin-bottom: 2rem;
}

/* Login Page */
.login-body {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem;
}

.login-card {
    background-color: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary);
    font-size: 2rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-form {
    margin-bottom: 2rem;
}

.login-footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 101, 26, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    text-decoration: none;
}

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

.btn-secondary:hover {
    background-color: #7f8c8d;
    text-decoration: none;
}

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

.btn-outline:hover {
    background-color: rgba(232, 101, 26, 0.1);
    text-decoration: none;
}

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

.btn-block {
    width: 100%;
}

.btn-full {
    width: 100%;
}

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

.alert-danger {
    background-color: #fde7e7;
    color: #c33d3d;
    border-left: 4px solid var(--danger);
}

.alert-success {
    background-color: #e7f5e7;
    color: #2d7a2d;
    border-left: 4px solid var(--success);
}

.alert-info {
    background-color: #e7f0f8;
    color: #1a5a8f;
    border-left: 4px solid var(--info);
}

.alert-warning {
    background-color: #fef3e7;
    color: #a65a1a;
    border-left: 4px solid var(--warning);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-large {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.badge-success {
    background-color: #e7f5e7;
    color: #27ae60;
}

.badge-info {
    background-color: #e7f0f8;
    color: #3498db;
}

.badge-warning {
    background-color: #fef3e7;
    color: #e67e22;
}

.badge-danger {
    background-color: #fde7e7;
    color: #e74c3c;
}

.badge-secondary {
    background-color: #e8eae9;
    color: #5a5a5a;
}

/* Jobs Table */
.search-container {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    max-width: 400px;
}

.jobs-table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem;
    display: none;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: var(--shadow-sm);
    border-radius: 4px;
    overflow: hidden;
}

.jobs-table thead {
    background-color: var(--primary);
    color: white;
}

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

.jobs-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.jobs-table tbody tr:hover {
    background-color: var(--bg-light);
    cursor: pointer;
}

.job-row {
    transition: var(--transition);
}

.job-row:hover {
    background-color: #f9f9f9;
}

/* Jobs Grid (Mobile) */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.job-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.job-card-header {
    background-color: var(--primary);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.job-card-header h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
    word-break: break-all;
}

.job-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.job-description {
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 500;
}

.job-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.job-meta p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-light);
}

.job-meta strong {
    color: var(--primary);
}

.job-card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* Job Detail Page */
.back-link {
    margin-bottom: 2rem;
}

.back-link a {
    color: var(--accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.job-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    gap: 2rem;
}

.job-detail-header > div {
    flex: 1;
}

.job-number {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.job-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.detail-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.detail-card h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.detail-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text);
    line-height: 1.5;
}

/* Attachments */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg);
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.attachment-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0;
}

/* Error Page */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.error-card {
    background-color: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 500px;
}

.error-title {
    color: var(--danger);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    background-color: white;
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    color: var(--text-light);
}

/* Footer */
.footer {
    background-color: var(--primary);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .jobs-table-responsive {
        display: none !important;
    }

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

    .job-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .job-detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-row {
        grid-template-columns: 100px 1fr;
    }

    .navbar-container {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .navbar-links {
        width: 100%;
        justify-content: space-between;
    }

    .user-info {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-left: 0;
        padding-top: 1rem;
        justify-content: space-between;
    }

    .page-container {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .attachment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn {
        width: 100%;
    }
}

@media (min-width: 769px) {
    .jobs-grid {
        display: none;
    }

    .jobs-table-responsive {
        display: block;
    }
}

/* Utility Classes */
.mb-1 {
    margin-bottom: 0.5rem;
}

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

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

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

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

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

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

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

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

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

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

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

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