/* ============================================================================
   SEW TRACKER - STYLE GUIDE
   Comprehensive styling system for uniform appearance across all pages
   ============================================================================ */

/* ----------------------------------------------------------------------------
   COLOR PALETTE
   ---------------------------------------------------------------------------- */
:root {
    /* Primary Colors */
    --color-primary: #667eea;
    --color-primary-dark: #764ba2;
    --color-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Background Colors */
    --color-bg-page: whitesmoke;
    --color-bg-container: white;
    --color-bg-hover: #f7fafc;
    --color-bg-selected: #edf2f7;
    
    /* Border Colors */
    --color-border-primary: silver;
    --color-border-light: #E2E8F0;
    --color-border-medium: #d0d5d5;
    
    /* Text Colors */
    --color-text-primary: #2d3748;
    --color-text-secondary: #666;
    --color-text-muted: #999;
    --color-text-link: #3182ce;
    --color-text-link-hover: #2c5aa0;
    
    /* Status Colors */
    --color-success: #48bb78;
    --color-warning: #ed8936;
    --color-danger: #f56565;
    --color-info: #4299e1;
    
    /* Highlight Colors */
    --color-highlight: #96d1eb;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
}

/* ----------------------------------------------------------------------------
   TYPOGRAPHY
   ---------------------------------------------------------------------------- */
body {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
}

/* ----------------------------------------------------------------------------
   LAYOUT
   ---------------------------------------------------------------------------- */
.page-body {
    background: var(--color-bg-page);
    margin: 6px 0;
    padding: 3px 0;
}

.page-container {
    background: var(--color-bg-container);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    min-height: 100vh;
    padding: var(--spacing-md);
}

.content-section {
    margin-bottom: var(--spacing-xl);
}

.section-header {
    font-weight: bold;
    margin-bottom: var(--spacing-md);
}

/* ----------------------------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    user-select: none;
}

.btn:focus,
.btn:active {
    outline: none;
    box-shadow: none;
}

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

/* Button Sizes */
.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* Button Variants */
.btn-primary {
    background: var(--color-primary-gradient);
    color: white;
    border-color: var(--color-primary);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4294 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-hover);
    border-color: var(--color-border-medium);
}

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

.btn-success:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover:not(:disabled) {
    background: #e53e3e;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-warning:hover:not(:disabled) {
    background: #dd6b20;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-info:hover:not(:disabled) {
    background: #3182ce;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    gap: var(--spacing-sm);
}

/* ----------------------------------------------------------------------------
   LINKS
   ---------------------------------------------------------------------------- */
a {
    color: var(--color-text-link);
    text-decoration: underline;
    transition: color 0.15s ease-in-out;
}

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

a:focus,
a:active {
    outline: none;
    box-shadow: none;
}

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

.link-muted:hover {
    color: var(--color-text-primary);
}

/* Suppress underlines on buttons and CTAs (not text links) */
.cta-button,
.cta-button:hover,
.cta-button-outline,
.cta-button-outline:hover,
.cta-primary,
.cta-primary:hover,
.cta-secondary,
.cta-secondary:hover,
.page-cta-btn,
.page-cta-btn:hover,
.btn,
.btn:hover,
a.btn,
a.btn:hover {
    text-decoration: none !important;
}

/* ----------------------------------------------------------------------------
   FORMS
   ---------------------------------------------------------------------------- */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-primary);
}

.form-label-required::after {
    content: " *";
    color: var(--color-danger);
}

.form-control {
    display: block;
    width: 100%;
    padding: var(--spacing-sm);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: white;
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--color-info);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-control:disabled {
    background-color: #f7fafc;
    opacity: 0.6;
    cursor: not-allowed;
}

.form-control-sm {
    padding: 4px 8px;
    font-size: 13px;
}

.form-control-lg {
    padding: 12px 16px;
    font-size: 16px;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-text {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 12px;
    color: var(--color-text-secondary);
}

.form-error {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 12px;
    color: var(--color-danger);
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ----------------------------------------------------------------------------
   TABLES
   ---------------------------------------------------------------------------- */
.table-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--color-border-primary);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

.table th {
    border-right: 1px solid var(--color-border-medium);
    border-bottom: 2px solid var(--color-border-primary);
    background: var(--color-primary-gradient);
    padding: var(--spacing-sm);
    font-weight: 600;
    color: white;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-align: left;
}

.table th:last-child {
    border-right: none;
}

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

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

.table td {
    border-right: 1px solid var(--color-border-light);
    padding: var(--spacing-sm);
    background: white;
}

.table td:last-child {
    border-right: none;
}

.table tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--color-border-light);
}

.table tbody tr:hover td {
    background: var(--color-bg-hover);
}

.table tbody tr.row-selected td {
    background: var(--color-bg-selected);
}

.table tfoot td,
.table tfoot th {
    border-top: 2px solid var(--color-border-primary);
    background: var(--color-primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Alternating row colors */
.table-striped tbody tr:nth-child(even) td {
    background: #f9fafb;
}

.table-striped tbody tr:nth-child(even):hover td {
    background: var(--color-bg-hover);
}

/* Compact table variant */
.table-sm th,
.table-sm td {
    padding: 6px;
    font-size: 13px;
}

/* ----------------------------------------------------------------------------
   CARDS
   ---------------------------------------------------------------------------- */
.card {
    background: white;
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.card-header {
    padding: var(--spacing-md);
    background: var(--color-primary-gradient);
    color: white;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.card-body {
    padding: var(--spacing-md);
}

.card-footer {
    padding: var(--spacing-md);
    background: var(--color-bg-hover);
    border-top: 1px solid var(--color-border-primary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ----------------------------------------------------------------------------
   ALERTS
   ---------------------------------------------------------------------------- */
.alert {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.alert-success {
    background-color: #f0fff4;
    border-color: #9ae6b4;
    color: #22543d;
}

.alert-danger {
    background-color: #fff5f5;
    border-color: #fc8181;
    color: #742a2a;
}

.alert-warning {
    background-color: #fffaf0;
    border-color: #fbd38d;
    color: #744210;
}

.alert-info {
    background-color: #ebf8ff;
    border-color: #90cdf4;
    color: #2c5282;
}

/* ----------------------------------------------------------------------------
   BADGES
   ---------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    border-radius: 3px;
}

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

.badge-success {
    background-color: var(--color-success);
    color: white;
}

.badge-danger {
    background-color: var(--color-danger);
    color: white;
}

.badge-warning {
    background-color: var(--color-warning);
    color: white;
}

.badge-info {
    background-color: var(--color-info);
    color: white;
}

.badge-secondary {
    background-color: #718096;
    color: white;
}

/* ----------------------------------------------------------------------------
   UTILITIES
   ---------------------------------------------------------------------------- */

/* Spacing */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }
.mt-5 { margin-top: var(--spacing-xl) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }
.mb-5 { margin-bottom: var(--spacing-xl) !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: var(--spacing-xs) !important; }
.pt-2 { padding-top: var(--spacing-sm) !important; }
.pt-3 { padding-top: var(--spacing-md) !important; }
.pt-4 { padding-top: var(--spacing-lg) !important; }
.pt-5 { padding-top: var(--spacing-xl) !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: var(--spacing-xs) !important; }
.pb-2 { padding-bottom: var(--spacing-sm) !important; }
.pb-3 { padding-bottom: var(--spacing-md) !important; }
.pb-4 { padding-bottom: var(--spacing-lg) !important; }
.pb-5 { padding-bottom: var(--spacing-xl) !important; }

/* Text alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Text colors */
.text-primary { color: var(--color-text-primary) !important; }
.text-secondary { color: var(--color-text-secondary) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info { color: var(--color-info) !important; }

/* Font weights */
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold { font-weight: 600 !important; }
.font-weight-bolder { font-weight: 700 !important; }

/* Display - Using Bootstrap's responsive display utilities (d-none, d-lg-block, etc.)
   Do not override here as it breaks responsive breakpoints */

/* Flexbox */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.gap-1 { gap: var(--spacing-xs) !important; }
.gap-2 { gap: var(--spacing-sm) !important; }
.gap-3 { gap: var(--spacing-md) !important; }
.gap-4 { gap: var(--spacing-lg) !important; }

/* Width */
.w-100 { width: 100% !important; }
.w-75 { width: 75% !important; }
.w-50 { width: 50% !important; }
.w-25 { width: 25% !important; }

/* ----------------------------------------------------------------------------
   LOADING STATES
   ---------------------------------------------------------------------------- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 0.8s linear infinite;
}

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

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 4px;
}

/* ----------------------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------------------- */
.site-footer {
    padding: 12px 0;
    text-align: center;
    font-size: 0.85em;
}

.site-footer-tagline {
    margin-bottom: 6px;
    font-weight: bold;
    color: #555;
}

.site-footer-social {
    margin-bottom: 12px;
}

.site-footer-social a {
    margin: 0 8px;
    text-decoration: none;
}

.site-footer-social svg {
    vertical-align: middle;
}

.site-footer-nav {
    margin-bottom: 12px;
}

.site-footer-nav a {
    color: gray;
}

.site-footer-values {
    margin-top: 4px;
}

.site-footer-values .value-growth { color: #138a43; }
.site-footer-values .value-simplicity { color: #667eea; }
.site-footer-values .value-community { color: #e67e22; }
.site-footer-values .value-service { color: #f30e0e; }

.site-footer-links {
    margin-top: 14px;
}

.site-footer-links a {
    color: gray;
}

/* ----------------------------------------------------------------------------
   PUBLIC PAGES (shared across homepage, about, contact, FAQ, login)
   ---------------------------------------------------------------------------- */

/* Page header banner */
.page-header {
    background: linear-gradient(135deg, rgba(209, 217, 249, 0) 0%, rgba(89, 14, 163, 0.2) 100%), url('/images/header-bg.webp') center/cover no-repeat;
    color: white;
    padding: 50px 20px;
    text-align: center;
    border-radius: 6px;
    margin-bottom: 30px;
}
.page-header h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}
.page-header p {
    font-size: 1.05em;
    opacity: 0.9;
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.6;
}

/* CTA button group (primary + secondary side by side) */
.cta-group {
    display: flex;
    gap: 14px;
    margin-top: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.cta-primary {
    display: inline-block;
    padding: 13px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}
.cta-secondary {
    display: inline-flex;
    align-items: center;
    padding: 13px 32px;
    background: transparent;
    color: #667eea;
    font-weight: bold;
    font-size: 14px;
    border: 2px solid #667eea;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}
.cta-secondary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    text-decoration: none;
}

/* Legal page body content (terms, privacy) */
.legal-content {
    padding: 10px 0;
}
.legal-content h2 {
    font-size: 19px;
    margin-top: 30px;
    margin-bottom: 12px;
}
.legal-content h3 {
    font-size: 17px;
    margin-top: 20px;
    margin-bottom: 10px;
}
.legal-content p {
    font-size: 14px;
    color: #595959;
    line-height: 1.6;
    margin-bottom: 12px;
}
.legal-content ul,
.legal-content ol {
    font-size: 14px;
    color: #595959;
    line-height: 1.6;
    margin-bottom: 12px;
    padding-left: 24px;
}
.legal-content ul li {
    margin-bottom: 6px;
}
.legal-content ol li {
    margin-bottom: 4px;
}
.legal-content a {
    color: #3030F1;
}
.legal-content .updated-date {
    font-size: 14px;
    color: #595959;
    margin-bottom: 20px;
}
.legal-content .toc-list {
    list-style: none;
    padding-left: 0;
}
.legal-content .toc-list li {
    margin-bottom: 4px;
}
.legal-content .toc-list a {
    color: #3030F1;
    text-decoration: none;
}
.legal-content .toc-list a:hover {
    text-decoration: underline;
}
.legal-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
    font-size: 14px;
}
.legal-content table th,
.legal-content table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border: 1px solid #ddd;
}
.legal-content table th {
    background-color: #f5f5f5;
    font-weight: bold;
}
@media (max-width: 600px) {
    .legal-content table {
        font-size: 12px;
    }
    .legal-content table th,
    .legal-content table td {
        padding: 6px 8px;
    }
}

/* Bottom-of-page CTA section */
.page-cta-section {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}
.page-cta-section h2,
.page-cta-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}
.page-cta-section p {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 20px;
}
.page-cta-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.page-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

/* ----------------------------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   ---------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .page-container {
        padding: var(--spacing-sm);
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .table-container {
        overflow-x: auto;
    }
}

/* ----------------------------------------------------------------------------
   PRINT STYLES
   ---------------------------------------------------------------------------- */
@media print {
    .no-print {
        display: none !important;
    }
    
    .page-body {
        background: white;
    }
    
    .page-container {
        border: none;
        box-shadow: none;
    }
}
