/*
 * Modern Professional Theme for Contractor Portal
 * Design: Clean, contemporary with blue/gray color scheme
 * Features: Smooth animations, card-based layout, modern typography
 */

:root {
    /* Modern Color Palette */
    --primary-color: #2563eb;        /* Blue 600 */
    --primary-hover: #1d4ed8;        /* Blue 700 */
    --primary-light: #3b82f6;        /* Blue 500 */
    --secondary-color: #64748b;      /* Slate 500 */
    --accent-color: #10b981;         /* Green 500 */
    --danger-color: #ef4444;         /* Red 500 */
    --warning-color: #f59e0b;        /* Amber 500 */

    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;         /* Slate 50 */
    --bg-tertiary: #f1f5f9;          /* Slate 100 */
    --text-primary: #0f172a;         /* Slate 900 */
    --text-secondary: #475569;       /* Slate 600 */
    --text-muted: #94a3b8;           /* Slate 400 */
    --border-color: #e2e8f0;         /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Spacing */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Dark mode colors (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --border-color: #334155;
    }
}

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

body {
    font-family: var(--font-sans) !important;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    border: none !important;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Container & Layout */
.container {
    max-width: 1200px !important;
    margin: 2rem auto !important;
    padding: 2rem !important;
    background: var(--bg-primary) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid var(--border-color) !important;
}

.section {
    margin-bottom: 2rem !important;
    padding: 1.5rem !important;
    background: var(--bg-secondary) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color) !important;
}

/* Buttons */
button, .button, input[type="submit"], input[type="button"] {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-family: var(--font-sans) !important;
    box-shadow: var(--shadow-sm) !important;
    width: auto !important;
    margin: 0.25rem !important;
}

button:hover, .button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-md) !important;
}

button:active, .button:active {
    transform: translateY(0) !important;
}

button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Button Variants */
.button-secondary {
    background: var(--secondary-color) !important;
}

.button-secondary:hover {
    background: #475569 !important;
}

.button-success {
    background: var(--accent-color) !important;
}

.button-success:hover {
    background: #059669 !important;
}

.button-danger, .remove-btn {
    background: var(--danger-color) !important;
}

.button-danger:hover, .remove-btn:hover {
    background: #dc2626 !important;
}

.back-btn {
    background: var(--secondary-color) !important;
}

.back-btn:hover {
    background: #475569 !important;
}

/* Forms */
input, select, textarea {
    width: 100% !important;
    padding: 0.625rem 0.875rem !important;
    margin: 0.5rem 0 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.875rem !important;
    font-family: var(--font-sans) !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease !important;
}

input:focus, select:focus, textarea:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted) !important;
}

label {
    display: block;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Tables */
table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: var(--bg-primary) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-sm) !important;
}

th {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    text-align: left !important;
    padding: 1rem !important;
    font-size: 0.875rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem !important;
    border-top: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-size: 0.875rem !important;
}

tr:hover td {
    background: var(--bg-secondary) !important;
}

/* Cards & Property Board */
.property-column {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md) !important;
}

.property-header {
    padding: 1rem !important;
    background: var(--bg-tertiary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.property-name {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
}

.property-address {
    color: var(--text-secondary) !important;
    font-size: 0.875rem !important;
}

.property-details {
    color: var(--text-muted) !important;
    font-size: 0.75rem !important;
}

.contractor-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 1rem !important;
    margin: 0.75rem !important;
    transition: all 0.2s ease !important;
}

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

.contractor-card.primary {
    border: 2px solid var(--primary-color) !important;
    background: rgba(37, 99, 235, 0.05) !important;
}

.contractor-name {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.primary-badge {
    background: var(--primary-color) !important;
    color: white !important;
    padding: 0.125rem 0.5rem !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Header */
.header {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.5rem !important;
    margin-bottom: 2rem !important;
    box-shadow: var(--shadow-md) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Password Section */
.password-section {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 1.5rem !important;
}

/* Alerts & Messages */
.message {
    padding: 1rem 1.25rem !important;
    border-radius: var(--radius-md) !important;
    margin: 1rem 0 !important;
    font-size: 0.875rem;
}

.message.loading {
    background: rgba(37, 99, 235, 0.1) !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color) !important;
}

.message.error {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger-color) !important;
    border: 1px solid var(--danger-color) !important;
}

.message.success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--accent-color) !important;
    border: 1px solid var(--accent-color) !important;
}

/* Links */
a {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

a:hover {
    color: var(--primary-hover) !important;
    text-decoration: underline !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-tertiary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

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

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

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* Responsive adjustments work with mobile-responsive.css */
@media screen and (max-width: 768px) {
    .container {
        margin: 1rem !important;
        padding: 1rem !important;
        border-radius: var(--radius-md) !important;
    }

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

    .header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

/* Print Styles */
@media print {
    body {
        background: white !important;
    }

    .container {
        box-shadow: none !important;
        border: none !important;
    }

    button, .button, .back-btn {
        display: none !important;
    }
}
