/* =============================================================================
   RESPAM.ORG - Mobile-First CSS Framework
   =============================================================================
   
   Table of Contents:
   1. Reset & Base
   2. Typography
   3. Layout
   4. Components
   5. Utilities
   6. Responsive Design
   
   Design System:
   - Primary Color: #1E90FF (DodgerBlue)
   - Secondary Color: #2C3E50 (Dark Blue)
   - Success: #27AE60 (Green)
   - Warning: #F39C12 (Orange)
   - Error: #E74C3C (Red)
   - Light: #F8F9FA
   - Dark: #343A40
   
   Breakpoints:
   - Mobile: 320px - 767px (default)
   - Tablet: 768px - 1023px
   - Desktop: 1024px+
   
============================================================================= */

/* =============================================================================
   1. RESET & BASE
============================================================================= */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: #343A40;
    background-color: #F8F9FA;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #1E90FF;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: #0066CC;
    text-decoration: underline;
}

a:focus {
    outline: 2px solid #1E90FF;
    outline-offset: 2px;
}

/* =============================================================================
   2. TYPOGRAPHY
============================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #2C3E50;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

p {
    margin-bottom: 1rem;
}

small {
    font-size: 0.875rem;
    color: #6C757D;
}

strong {
    font-weight: 600;
}

/* =============================================================================
   3. LAYOUT
============================================================================= */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main {
    flex: 1;
    padding: 1rem 0;
    padding-left: 20px !important;
}

/* Grid System - Mobile First */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col {
    flex: 1;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

.col-12 { flex: 0 0 100%; }
.col-6 { flex: 0 0 50%; }
.col-4 { flex: 0 0 33.333333%; }
.col-3 { flex: 0 0 25%; }

/* Form Layouts */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.form-section h2 {
    color: #2C3E50;
    border-bottom: 2px solid #1E90FF;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* =============================================================================
   4. COMPONENTS
============================================================================= */

/* Header & Navigation */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    padding: 0.75rem 0;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo .logo {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #1E90FF;
}

.nav-menu {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-weight: 500;
    color: #2C3E50;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #1E90FF;
    text-decoration: none;
}

.nav-user {
    font-size: 0.875rem;
    color: #6C757D;
    padding: 0.5rem 0.75rem;
    background: #F8F9FA;
    border-radius: 4px;
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    padding: 4px 0;
}

.nav-toggle span {
    width: 100%;
    height: 2px;
    background: #2C3E50;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu */
.nav-mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
}

.nav-mobile.active {
    display: flex;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch target for mobile */
    gap: 0.5rem;
}

.btn:focus {
    outline: 2px solid #1E90FF;
    outline-offset: 2px;
}

.btn-primary {
    background: #1E90FF;
    color: white;
    border-color: #1E90FF;
}

.btn-primary:hover {
    background: #0066CC;
    border-color: #0066CC;
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: #6C757D;
    color: white;
    border-color: #6C757D;
}

.btn-secondary:hover {
    background: #545B62;
    border-color: #545B62;
    color: white;
    text-decoration: none;
}

.btn-success {
    background: #27AE60;
    color: white;
    border-color: #27AE60;
}

.btn-success:hover {
    background: #229954;
    border-color: #229954;
    color: white;
    text-decoration: none;
}

.btn-danger {
    background: #E74C3C;
    color: white;
    border-color: #E74C3C;
}

.btn-danger:hover {
    background: #DC3545;
    border-color: #DC3545;
    color: white;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: #1E90FF;
    border-color: #1E90FF;
}

.btn-outline:hover {
    background: #1E90FF;
    color: white;
    text-decoration: none;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 48px;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    min-height: 36px;
}

.btn-full {
    width: 100%;
}

.btn-copy,
.btn-remove {
    padding: 0.5rem;
    min-width: 44px;
    border-radius: 4px;
}

.btn-copy {
    background: #F8F9FA;
    color: #495057;
    border-color: #DEE2E6;
}

.btn-copy:hover {
    background: #E9ECEF;
    color: #495057;
    text-decoration: none;
}

.btn-remove {
    background: #DC3545;
    color: white;
    border-color: #DC3545;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #2C3E50;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #DEE2E6;
    border-radius: 6px;
    background: white;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-height: 44px; /* Touch target */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1E90FF;
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
}

.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    border-color: #E74C3C;
}

.form-help {
    font-size: 0.875rem;
    color: #6C757D;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #DEE2E6;
    margin-top: 2rem;
}

/* Email Address Rows */
.email-address-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #F8F9FA;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #DEE2E6;
    background: #F8F9FA;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #DEE2E6;
    background: #F8F9FA;
}

/* Dashboard Components */
.welcome-section {
    background: linear-gradient(135deg, #1E90FF, #0066CC);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-section h1 {
    color: white;
    margin-bottom: 0.5rem;
}

.company-info {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1E90FF;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6C757D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-card h3 {
    color: #2C3E50;
    margin-bottom: 1rem;
}

.email-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #F8F9FA;
    border-radius: 6px;
    margin: 1rem 0;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 1rem 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #DEE2E6;
}

.table th {
    background: #F8F9FA;
    font-weight: 600;
    color: #2C3E50;
}

.table tr:hover {
    background: #F8F9FA;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.status-active {
    background: #D4EDDA;
    color: #155724;
}

.status-reviewing {
    background: #CCE5FF;
    color: #004085;
}

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

.status-rejected {
    background: #F8D7DA;
    color: #721C24;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.alert-success {
    background: #D4EDDA;
    color: #155724;
    border-color: #C3E6CB;
}

.alert-error,
.alert-danger {
    background: #F8D7DA;
    color: #721C24;
    border-color: #F5C6CB;
}

.alert-warning {
    background: #FFF3CD;
    color: #856404;
    border-color: #FFEAA7;
}

.alert-info {
    background: #CCE5FF;
    color: #004085;
    border-color: #B8DAFF;
}

/* Auth Components */
.auth-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.auth-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
}

.auth-form {
    margin-bottom: 2rem;
}

.auth-footer {
    text-align: center;
    color: #6C757D;
    font-size: 0.875rem;
}

.auth-info {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.auth-info h3,
.auth-info h4 {
    color: #2C3E50;
    margin-bottom: 1rem;
}

.auth-info ul,
.auth-info ol {
    padding-left: 1.5rem;
}

.auth-info li {
    margin-bottom: 0.5rem;
}

.info-box {
    background: #F8F9FA;
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 1.5rem;
}

/* Profile Components */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    text-align: center;
}

.profile-info {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.profile-info h3 {
    color: #2C3E50;
    margin-bottom: 1rem;
}

.profile-info ul {
    padding-left: 1.5rem;
}

.profile-info li {
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: #2C3E50;
    color: white;
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #1E90FF;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #BDC3C7;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #1E90FF;
    text-decoration: none;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-logo .logo {
    width: 32px;
    height: 32px;
}

.footer-logo span {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #1E90FF;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495E;
}

.footer-bottom p {
    color: #BDC3C7;
    font-size: 0.875rem;
    margin: 0;
}

/* =============================================================================
   5. UTILITIES
============================================================================= */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: #1E90FF; }
.text-secondary { color: #6C757D; }
.text-success { color: #27AE60; }
.text-danger { color: #E74C3C; }
.text-warning { color: #F39C12; }

.bg-primary { background-color: #1E90FF; }
.bg-secondary { background-color: #6C757D; }
.bg-light { background-color: #F8F9FA; }
.bg-white { background-color: white; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* =============================================================================
   6. RESPONSIVE DESIGN - Mobile First
============================================================================= */

/* Tablet (768px and up) */
@media (min-width: 768px) {
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    /* Layout */
    .container {
        padding: 0 1.5rem;
    }
    
    .main {
        padding: 2rem 0;
        padding-left: 20px !important;
    }
    
    /* Navigation */
    .nav-menu {
        display: flex;
    }
    
    .nav-toggle {
        display: none;
    }
    
    /* Forms */
    .form-row {
        flex-direction: row;
        align-items: flex-end;
    }
    
    .form-row .form-group {
        flex: 1;
        margin-bottom: 0;
    }
    
    .form-row .form-group:not(:last-child) {
        margin-right: 1rem;
    }
    
    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .form-actions .btn {
        width: auto;
    }
    
    /* Email Address Rows */
    .email-address-row {
        flex-direction: row;
        align-items: flex-end;
    }
    
    .email-address-row .form-group {
        flex: 1;
        margin-bottom: 0;
        margin-right: 1rem;
    }
    
    .email-address-row .btn-remove {
        margin-bottom: 0;
        align-self: flex-end;
    }
    
    /* Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Email Display */
    .email-display {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Auth */
    .auth-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        max-width: 1000px;
        margin: 2rem auto;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    /* Typography */
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    
    /* Layout */
    .container {
        padding: 0 2rem;
    }
    
    .main {
        padding: 3rem 0;
        padding-left: 20px !important;
    }
    
    /* Grid */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
    
    /* Tables */
    .table {
        font-size: 1rem;
    }
    
    /* Cards */
    .welcome-section {
        padding: 3rem 2rem;
    }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .form-sections {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .form-section:last-child {
        grid-column: span 2;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .nav-toggle,
    .btn {
        display: none !important;
    }
    
    .main {
        padding: 0;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .card,
    .form-section {
        box-shadow: none;
        border: 1px solid #DEE2E6;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border-color: #000;
    }
    
    .btn-secondary {
        background: #333;
        border-color: #333;
    }
    
    .alert {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --border-color: #333;
    }
    
    /* Dark mode styles would go here if needed */
}
