/* Portal Main Styles - Steller Brand Identity */
/* Based on floorsbysteller.com styling */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Nunito:wght@400;600;700&display=swap');

:root {
    /* Steller Brand Colors */
    --primary-color: #3E4539;
    /* Deep Forest Green */
    --secondary-color: #E1DCCE;
    /* Warm Tan */
    --accent-color: #d4a574;
    /* Gold accent */
    --text-dark: #000000;
    /* True Black */
    --text-light: #666;
    --bg-light: #f8f8f8;
    --border-color: #ddd;
    --error-color: #c53030;
    --success-color: #38a169;

    /* Steller Fonts */
    --font-heading: 'Figtree', sans-serif;
    --font-body: 'Nunito', sans-serif;
}

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

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-dark);
    background: #FFFFFF;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

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

header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.8;
}

/* Grey logout button in header */
.btn-logout {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 0.875rem;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 0.85;
}

main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Buttons - Square corners (Steller brand) */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 0;
    /* Square corners */
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

button[type="submit"] {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border-radius: 0;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    /* Pill-shaped inputs */
    font-size: 1rem;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.helper-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0;
    /* Square corners */
}

.login-container h2 {
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.success-message {
    background: #c6f6d5;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.error-message {
    background: #fed7d7;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Dashboard */
.dashboard h2 {
    margin-bottom: 1.5rem;
}

.actions {
    margin-bottom: 2rem;
}

.estimates-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.estimates-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.estimates-table th,
.estimates-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.estimates-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.no-estimates {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-dark);
}

/* Stain Grid with Thumbnails */
.stain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.stain-card {
    border: 2px solid var(--border-color);
    border-radius: 0;
    /* Square corners */
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.stain-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stain-card.selected {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.stain-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.stain-card h4 {
    font-size: 0.875rem;
    color: var(--text-dark);
    margin: 0;
}

/* Price Preview */
.price-preview {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    text-align: center;
}

.price-preview h3 {
    color: var(--primary-color);
    margin: 0;
}

/* Quote Display */
.quote-header {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.quote-header h4 {
    margin: 0 0 0.25rem 0;
    color: var(--primary-color);
}

.quote-header p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.quote-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-dark);
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 0;
    /* Square corners */
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary:hover {
    opacity: 0.9;
}

/* Quote Table */
.quote-table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.quote-table th,
.quote-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.quote-table th {
    background: var(--bg-light);
}

.quote-summary {
    text-align: right;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 4px;
    margin-top: 1rem;
}

.quote-summary .total {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

/* Small button variant */
.btn-sm {
    padding: 6px 16px;
    font-size: 0.875rem;
}

/* Status badges for estimate actions */
.btn-status-badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.875rem;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 0;
    border: none;
    cursor: default;
}

.btn-status-approved {
    background: var(--secondary-color);
    color: var(--text-dark);
    opacity: 0.65;
}

.btn-status-pending {
    background: #6c757d;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-status-pending:hover {
    opacity: 0.85;
}

/* Pending modal styling */
.pending-modal-content {
    max-width: 500px;
    text-align: center;
}

.pending-modal-header h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.pending-modal-body {
    margin-bottom: 1.5rem;
}

.pending-modal-body p {
    margin-bottom: 1rem;
}

.pending-modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Loading Spinner */
.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.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Delete button */
.btn-delete {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: 4px;
}

.btn-delete:hover:not(:disabled) {
    color: #d9534f;
    background: rgba(217, 83, 79, 0.1);
}

.btn-delete.btn-disabled {
    color: #ccc;
    cursor: not-allowed;
}