/* Next Telecom Brand CSS Variables */
:root {
    --turq-next-highlight: #30c1d7;
    --24-purple: #191c4f;
    --white: white;
    --newdarkblue: #091023;
    --grey: #888;
    --midnight-blue-2: #151f3a;
    --newbluefilterdark: #021735d9;
    --new-very-dark-blue-filter: #091023f2;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--24-purple);
    background-image: url('https://imagedelivery.net/FzKraxyOjvL869MIz_kSHQ/3c6fa485-188b-4835-cf84-e66936ca6700/Large');
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 120px 20px 20px 20px;
    position: relative;
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 16, 35, 0.45);
    z-index: -1;
}

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

.hidden {
    display: none !important;
}

/* Fixed Header */
.header {
    background: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-height: 80px;
}

.header-logo img {
    height: 60px;
    width: auto;
}

.header-text {
    text-align: center;
    flex: 1;
}

.header-text h1 {
    font-size: 1.6em;
    margin-bottom: 3px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--24-purple);
}

.header-text p {
    font-size: 0.9em;
    color: var(--grey);
    font-weight: 400;
}

/* Glass-morphism card style */
.glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* White card variant */
.white-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: none;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Login Page */
.login-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    margin: 50px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
    color: var(--24-purple);
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    color: var(--grey);
    margin-bottom: 30px;
    font-weight: 400;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
    background: white;
    color: var(--24-purple);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--turq-next-highlight);
    box-shadow: 0 0 0 3px rgba(48, 193, 215, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--turq-next-highlight);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(48, 193, 215, 0.4);
    background: #28afc4;
}

.btn-secondary {
    padding: 10px 20px;
    background: white;
    color: var(--24-purple);
    border: 2px solid var(--turq-next-highlight);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

.btn-secondary:hover {
    background: var(--turq-next-highlight);
    color: white;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

/* Portal Header */
.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.portal-header-content h2 {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.supplier-name {
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-bar select {
    padding: 12px 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95);
    color: var(--24-purple);
    font-weight: 500;
    transition: all 0.3s;
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--turq-next-highlight);
    box-shadow: 0 0 0 3px rgba(48, 193, 215, 0.2);
}

/* Jobs List */
.jobs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

.job-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.job-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    border-color: var(--turq-next-highlight);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.job-id {
    font-size: 20px;
    font-weight: 700;
    color: var(--24-purple);
}

.job-type {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.job-type.fault {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.job-type.service {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
    border: 2px solid #f39c12;
}

.job-type.installation {
    background: rgba(48, 193, 215, 0.1);
    color: var(--turq-next-highlight);
    border: 2px solid var(--turq-next-highlight);
}

.job-priority {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
    display: inline-block;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
    display: inline-block;
}

.status-onsite {
    background: #fff3cd;
    color: #856404;
    animation: pulse 2s infinite;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-confirmed {
    background: #d1ecf1;
    color: #0c5460;
}

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

.priority-high {
    background: #fee;
    color: #e74c3c;
}

.priority-medium {
    background: #ffe;
    color: #f39c12;
}

.priority-low {
    background: #eff;
    color: #3498db;
}

.job-field {
    margin-bottom: 10px;
}

.job-field-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 3px;
}

.job-field-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.appointment-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
}

.appointment-status.pending {
    background: #fff3cd;
    color: #856404;
}

.appointment-status.confirmed {
    background: #d4edda;
    color: #155724;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.loading p {
    color: var(--24-purple);
    font-weight: 500;
}

.spinner {
    border: 4px solid rgba(48, 193, 215, 0.2);
    border-top: 4px solid var(--turq-next-highlight);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* No Jobs Message */
.no-jobs {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.no-jobs p {
    color: var(--grey);
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

.job-detail-header {
    background: var(--24-purple);
    color: white;
    padding: 30px;
    border-radius: 10px 10px 0 0;
    position: relative;
    overflow: hidden;
}

.job-detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(48, 193, 215, 0.2) 100%);
    pointer-events: none;
}

.job-detail-header h2 {
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.job-detail-header p {
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.job-detail-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.detail-section {
    margin-bottom: 30px;
}

.detail-section h3 {
    color: var(--24-purple);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(48, 193, 215, 0.3);
    font-weight: 600;
}

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

.detail-field {
    margin-bottom: 15px;
}

.detail-field-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 600;
}

.detail-field-value {
    font-size: 15px;
    color: #333;
}

.appointment-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.appointment-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-confirm {
    flex: 1;
    padding: 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
}

.btn-confirm:hover {
    background: #229954;
}

.btn-decline {
    flex: 1;
    padding: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
}

.btn-decline:hover {
    background: #c0392b;
}

/* Time Tracking Styling */
.time-tracking-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.btn-checkin,
.btn-checkout {
    transition: all 0.3s;
}

.btn-checkin:hover {
    background: #229954 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.btn-checkout:hover {
    background: #c0392b !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Photo Upload Styling */
.photo-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 10px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-preview-overlay span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 5px;
}

.btn-upload-photos {
    transition: all 0.3s;
    background: var(--turq-next-highlight) !important;
}

.btn-upload-photos:hover {
    background: #28afc4 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(48, 193, 215, 0.4);
}

.btn-upload-photos:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.uploaded-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* Terms & Conditions Styling */
.terms-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    max-height: 500px;
    overflow-y: auto;
    color: var(--24-purple);
}

.terms-container h2 {
    color: #d9534f;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
}

.terms-container h3 {
    color: var(--24-purple);
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 17px;
    border-bottom: none;
    padding-bottom: 0;
    font-weight: 600;
}

.terms-container ul {
    margin-left: 25px;
    margin-bottom: 15px;
    color: var(--24-purple);
}

.terms-container li {
    margin-bottom: 10px;
    line-height: 1.7;
    color: var(--24-purple);
}

.terms-container strong {
    color: #d9534f;
    font-weight: 700;
}

.terms-container div {
    color: var(--24-purple);
}

.terms-container p {
    color: var(--24-purple);
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .jobs-list {
        grid-template-columns: 1fr;
    }
    
    .portal-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .terms-container {
        max-height: 300px;
    }
}
