/*
 * Highbrook Homes Portal - Build Team Portal Specific Styles
 * Only used by: Build Team Portal
 * RESTORED TO ORIGINAL STYLING (pre-refactor)
 */

/* ========================================
   BUILD TEAM SPECIFIC STYLES
   ======================================== */

/* Override body background for Build Team dashboard pages (not gradient pages) */
body.buildteam-dashboard {
    background: #f5f7fa;
}

/* Override for login/auth pages with gradient background */
body.with-gradient {
    background: linear-gradient(to bottom right, var(--gradient-start) 0%, var(--gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.header {
    background: linear-gradient(to bottom right, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 20px;
    margin-bottom: 4px;
    color: white;
}

.header-left p {
    font-size: 14px;
    opacity: 0.9;
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    text-align: right;
    color: white;
}

/* Dashboard header user info - must be white */
.header .user-info .user-name,
.header-right .user-name {
    font-size: 16px;
    font-weight: 600;
    color: white !important;
}

.header .user-info .user-phone,
.header-right .user-phone {
    font-size: 12px;
    opacity: 0.8;
    color: white !important;
}

/* Keep btn-signout - it's specific to Build Team header */
.btn-signout {
    background: #e53e3e;
    color: white;
    border: none;
    font-size: 14px;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--radius-md);
}

.btn-signout:hover {
    background: #c53030;
}

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

/* Build Team override for full-width primary buttons */
.btn-primary {
    width: 100%;
    padding: 18px 40px;
    font-size: 18px;
}

.attendance-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.attendance-status {
    font-size: 64px;
    margin-bottom: 24px;
}

.attendance-card h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 12px;
}

.attendance-card p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.status-badge.signed-in {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-badge.signed-out {
    background: var(--error-bg);
    color: var(--error-text);
}

.attendance-time {
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
}

/* Error and success messages - using components.css styles */

.info-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: var(--primary-purple);
    font-size: 20px;
    margin-bottom: 16px;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    color: #666;
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
}

.info-card li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-purple);
    font-weight: bold;
}

.footer {
    text-align: center;
    padding: 32px 20px;
    color: #888;
    font-size: 14px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Site Manager Styles */
.manager-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.manager-card h3 {
    color: var(--primary-purple);
    font-size: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.manager-badge {
    background: linear-gradient(to bottom right, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.company-section {
    margin-bottom: 32px;
}

.company-section:last-child {
    margin-bottom: 0;
}

.company-header {
    background: #f5f7fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.company-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.company-trade {
    font-size: 14px;
    color: #666;
    margin-left: 8px;
}

.worker-count {
    font-size: 14px;
    color: #666;
}

.worker-list {
    display: grid;
    gap: 12px;
}

.worker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.worker-info {
    flex: 1;
}

.worker-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.worker-details {
    font-size: 13px;
    color: #666;
}

.worker-time {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
}

.btn-signout-worker {
    background: #e53e3e;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-signout-worker:hover {
    background: #c53030;
}

.btn-signout-worker:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Auth Container (for login pages) */
.auth-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px 30px;
    max-width: 420px;
    width: 100%;
}

/* Welcome Container (for welcome-back/reenter pages) */
.welcome-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 50px 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

/* Blocked Container */
.blocked-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px 30px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

/* Coming Soon Container */
.coming-soon-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 50px 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.logo {
    text-align: center;
    margin-bottom: 32px;
    font-size: 64px;
}

.logo h1 {
    font-size: 28px;
    color: var(--primary-purple);
    margin-bottom: 8px;
}

.logo p {
    color: #666;
    font-size: 16px;
}

.logo .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.instruction {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.6;
}

.phone-display {
    text-align: center;
    font-weight: 600;
    color: var(--primary-purple);
    font-size: 18px;
    margin-bottom: 32px;
}

h1 {
    color: var(--primary-purple);
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 700;
}

.user-name {
    color: #2d3748;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Subtitle and divider styles are in base.css */

.signout-link,
.different-number-link {
    color: #718096;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    transition: color 0.3s;
}

.signout-link:hover,
.different-number-link:hover {
    color: var(--primary-purple);
    text-decoration: underline;
}

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

label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 14px;
    text-align: center;
}

.input-wrapper {
    position: relative;
}

input[type="tel"],
input[type="text"] {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
    font-family: inherit;
}

/* Special styling for verification code input */
input[type="text"]#code,
input[type="text"][maxlength="7"] {
    padding: 20px;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 8px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

input[type="tel"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-purple);
}

input[type="tel"].pre-filled,
input[type="text"].pre-filled {
    border-color: var(--primary-purple);
    background: #f8f9ff;
}

.change-number {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-purple);
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    display: none;
}

.change-number:hover {
    text-decoration: underline;
}

.welcome-back {
    color: var(--primary-purple);
    font-size: 14px;
    margin-bottom: 12px;
    display: none;
}

.help-text {
    color: #888;
    font-size: 13px;
    margin-top: 8px;
}

.btn-link {
    background: none;
    color: var(--primary-purple);
    text-decoration: underline;
    padding: 12px;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--gradient-start);
}

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

.resend-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.resend-text {
    color: #888;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ========================================
   TIER 4 ITEMS 23 & 24: DYNAMIC SECTIONS + OPTIMISTIC UI
   ======================================== */

/* Section refresh button */
.section-refresh-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 12px;
    border-radius: 6px;
    transition: all 0.2s;
    opacity: 0.6;
}

.section-refresh-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    opacity: 1;
    transform: rotate(90deg);
}

.section-refresh-btn:active {
    transform: rotate(180deg);
}

/* Section loading state */
.section-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

/* Section spinner overlay */
.section-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

/* Spinner animation */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Workers list and suspicious list containers */
.workers-list,
.suspicious-list {
    transition: opacity 0.3s ease;
}

/* No workers/suspicious message */
.no-workers,
.no-suspicious {
    text-align: center;
    padding: 32px 20px;
    color: #888;
    font-size: 15px;
}

.no-suspicious {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 16px;
}

.no-suspicious .icon {
    font-size: 24px;
}

.no-suspicious p {
    margin: 0;
    color: #166534;
    font-weight: 500;
}

/* Suspicious item styles */
.suspicious-item {
    padding: 12px 16px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #feb2b2;
}

.suspicious-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.suspicious-header .icon {
    font-size: 18px;
}

.suspicious-header strong {
    color: #c53030;
    font-size: 15px;
}

.suspicious-details {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.suspicious-details > div {
    margin-bottom: 2px;
}

.mismatch-reason {
    color: #e53e3e !important;
    font-weight: 600;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .header-right {
        flex-direction: column;
        width: 100%;
    }

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

    .attendance-card {
        padding: 32px 20px;
    }

    .attendance-card h2 {
        font-size: 24px;
    }

    .attendance-status {
        font-size: 48px;
    }

    /* Button styles are in components.css */

    .worker-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-signout-worker {
        width: 100%;
    }

    .auth-container {
        padding: 30px 20px;
    }

    .welcome-container {
        padding: 40px 30px;
    }

    .logo {
        font-size: 48px;
    }

    .logo h1 {
        font-size: 24px;
    }

    h1 {
        font-size: 28px;
    }

    .user-name {
        font-size: 20px;
    }

    input[type="tel"],
    input[type="text"] {
        font-size: 16px;
    }

    /* Verify code input on mobile */
    input[type="text"]#code,
    input[type="text"][maxlength="7"] {
        font-size: 28px;
        letter-spacing: 6px;
    }
}

@media (max-width: 480px) {
    .attendance-card {
        padding: 24px 16px;
    }

    input[type="text"]#code,
    input[type="text"][maxlength="7"] {
        font-size: 28px;
        letter-spacing: 6px;
    }
}
