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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* Landing Page Styles */
.landing-page {
    display: none;
}

body:not(.user-logged-in) .landing-page {
    display: block;
}

body:not(.user-logged-in) .hero,
body:not(.user-logged-in) .policy-types,
body:not(.user-logged-in) .organizations,
body:not(.user-logged-in) .policies,
body:not(.user-logged-in) .admin-section,
body:not(.user-logged-in) footer,
body:not(.user-logged-in) .navbar {
    display: none !important;
    visibility: hidden !important;
}

.landing-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
    color: white;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    padding: 60px 0;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.landing-hero * {
    position: relative;
    z-index: 1;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
}

.landing-logo {
    display: flex;
    align-items: center;
}

.landing-auth {
    display: flex;
    gap: 15px;
}

.btn-landing {
    padding: 12px 24px;
    border: 2px solid white;
    background: transparent;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-landing:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.landing-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 40px;
}

.landing-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease;
}

.landing-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: fadeInUp 1s ease 0.2s both;
}

.landing-buttons {
    display: flex;
    gap: 20px;
    animation: fadeInUp 1.2s ease 0.4s both;
}

.btn-large {
    padding: 14px 35px;
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-about {
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
    padding: 100px 20px;
    position: relative;
}

.landing-about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}

.landing-about h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 60px;
    color: #1f2937;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.about-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s;
}

.about-card:hover::before {
    left: 100%;
}

.about-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.about-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    color: white;
    font-size: 2rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.4s ease;
}

.about-card:hover .about-icon {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.about-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #1f2937;
    font-weight: 700;
}

.about-card p {
    color: #6b7280;
    line-height: 1.7;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.about-card:hover p {
    color: #4b5563;
}

@media (max-width: 768px) {
    .landing-header {
        padding: 15px 20px;
    }
    
    .landing-title {
        font-size: 2.8rem;
        margin-bottom: 15px;
    }
    
    .landing-subtitle {
        font-size: 1.15rem;
        margin-bottom: 30px;
    }
    
    .landing-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
    }
    
    .btn-large {
        width: 100%;
        padding: 16px 35px;
        font-size: 1.05rem;
    }
    
    .landing-about {
        padding: 60px 20px;
    }
    
    .landing-about h2 {
        font-size: 2rem;
        margin-bottom: 40px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .about-card {
        padding: 30px 25px;
    }
    
    .about-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
}

/* Pricing Card Styles */
.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    #pricingModal .modal-content div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
}

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

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    min-height: 70px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
    height: auto;
}

.nav-logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.logo-img {
    width: auto !important;
    height: 100px !important;
    margin-right: 0 !important;
    max-width: none !important;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-divider {
    width: 1px;
    height: 25px;
    background: #e5e7eb;
    margin: 0 2px;
}

.nav-link {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: #2563eb;
    background: #f3f4f6;
}

.nav-link i {
    font-size: 0.9rem;
}

.admin-link {
    color: #8B5CF6 !important;
}

.admin-link:hover {
    color: white !important;
    background: #8B5CF6 !important;
}

.auth-btn {
    padding: 6px 14px !important;
    border-radius: 6px !important;
}

.auth-btn.signup-btn {
    background: #667eea !important;
    color: white !important;
}

.auth-btn.signup-btn:hover {
    background: #5568d3 !important;
    color: white !important;
}

.master-admin-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-radius: 6px;
    padding: 6px 12px !important;
    font-size: 0.9rem !important;
}

.master-admin-link:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: white !important;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #f3f4f6;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 180px 0 120px;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-secondary:hover {
    background: #2563eb;
    color: white;
}

.btn-outline {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-outline:hover {
    background: #2563eb;
    color: white;
}

/* Policy Types Section */
.policy-types {
    padding: 80px 0;
    background: white;
}

.policy-types h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #1f2937;
}

.policy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    align-items: stretch;
}

.policy-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.policy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.policy-icon {
    width: 80px;
    height: 80px;
    background: #dbeafe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #2563eb;
    font-size: 2rem;
}

.policy-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #1f2937;
}

.policy-card p {
    color: #6b7280;
    margin-bottom: 25px;
    flex-grow: 1;
    min-height: 48px;
}

.policy-card .btn-outline {
    margin-top: auto;
}

/* Organizations Section */
.organizations {
    padding: 80px 0;
    background: #f8fafc;
}

.organizations h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #1f2937;
}

.organization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.organization-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.organization-card:hover {
    transform: translateY(-3px);
}

.organization-card i {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 15px;
}

.organization-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #1f2937;
}

.organization-card p {
    color: #6b7280;
}

/* Policies Section */
.policies {
    padding: 80px 0;
    background: white;
}

.policies h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #1f2937;
}

.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto 30px;
}

.search-bar input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: #2563eb;
}

.search-bar i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
    min-width: fit-content;
    font-size: 0.95rem;
    text-align: center;
}

.filter-btn.active,
.filter-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.policies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

/* Policy card cleanup */
.policy-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.policy-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.policy-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.policy-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #ffffff;
    background: #9ca3af; /* default */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.policy-thumb.admin { background: #3b82f6; }
.policy-thumb.sog { background: #f59e0b; }
.policy-thumb.protocol { background: #10b981; }
.policy-thumb.memo { background: #8b5cf6; }
.policy-thumb.training { background: #ec4899; }
.policy-thumb.governance { background: #6366f1; }

.policy-card-title {
    flex: 1;
    min-width: 0;
}

.policy-card-title .policy-title {
    margin: 0;
    font-size: 1.05rem;
    color: #111827;
    line-height: 1.3;
}

.policy-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.policy-code-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.policy-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.policy-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.policy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.policy-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    flex: 1;
}

.policy-type-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.policy-type-badge.admin {
    background: #fef3c7;
    color: #92400e;
}

.policy-type-badge.sog {
    background: #dbeafe;
    color: #1e40af;
}

.policy-type-badge.memo {
    background: #f3e8ff;
    color: #7c3aed;
}

.policy-organizations {
    color: #374151;
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.policy-organizations i {
    color: #667eea;
    margin-right: 8px;
}

.policy-dates {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.policy-date-item {
    color: #6b7280;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.policy-date-item i {
    color: #667eea;
    width: 16px;
}

/* Admin Section */
.admin-section {
    padding: 80px 0;
    background: #f8fafc;
}

.draft-management {
    margin-top: 40px;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.draft-management h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.draft-list {
    display: grid;
    gap: 15px;
}

.draft-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.draft-item:hover {
    background: #f1f5f9;
    border-color: #2563eb;
}

.draft-info h4 {
    color: #1f2937;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.draft-info p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.draft-actions {
    display: flex;
    gap: 10px;
}

.draft-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s;
}

.draft-btn.edit {
    background: #2563eb;
    color: white;
}

.draft-btn.edit:hover {
    background: #1d4ed8;
}

.draft-btn.delete {
    background: #dc2626;
    color: white;
}

.draft-btn.delete:hover {
    background: #b91c1c;
}

.draft-btn.publish {
    background: #059669;
    color: white;
}

.draft-btn.publish:hover {
    background: #047857;
}

.admin-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #1f2937;
}

.admin-actions {
    text-align: center;
    margin-bottom: 50px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card i {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 5px;
}

.stat-card p {
    color: #6b7280;
}

/* Modal */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #6b7280;
}

.close:hover {
    color: #374151;
}

.modal-body {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group select[multiple] {
    height: 100px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
}

/* AI Features */
.ai-intro {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #0c4a6e;
}

.ai-intro p {
    margin: 0;
    font-weight: 500;
}

.ai-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

.ai-loading {
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.ai-resolution {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.ai-resolution h5 {
    color: #2563eb;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.ai-resolution .policy-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f3f4f6;
}

.ai-resolution .policy-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ai-resolution .section-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.ai-resolution .section-content {
    color: #374151;
    line-height: 1.6;
    font-size: 0.9rem;
}

.ai-result-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.company-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.company-info strong {
    display: block;
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.company-info small {
    color: #64748b;
    font-size: 0.9rem;
}

/* Enhanced Modal Styles */
.modal-content.signup-modal,
.modal-content.login-modal {
    max-width: 450px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 24px;
}

.modal-header h3 {
    text-align: center;
    margin-bottom: 8px;
    color: #1e293b;
    font-size: 1.8rem;
    font-weight: 600;
}

.modal-subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    z-index: 1;
}

.input-group input {
    padding-left: 45px !important;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-full {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-full i {
    margin-right: 8px;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.modal-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.modal-footer a:hover {
    text-decoration: underline;
}

.form-help {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 0.85rem;
}

/* Enhanced Modal Styles */
.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Policy Preview Styles */
.policy-preview {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.policy-preview.professional {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.policy-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.policy-info .info-item {
    margin-bottom: 8px;
    color: #0c4a6e;
    font-size: 0.9rem;
}

.policy-info .info-item:last-child {
    margin-bottom: 0;
}

.policy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.policy-header h4 {
    color: #1f2937;
    font-size: 1.5rem;
    margin: 0;
}

.policy-meta {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.policy-meta .meta-item {
    color: #374151;
    font-size: 0.9rem;
}

.policy-meta .meta-item strong {
    color: #1f2937;
    font-weight: 600;
}

.policy-type-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.policy-type-badge.admin {
    background: #fef3c7;
    color: #92400e;
}

.policy-type-badge.sog {
    background: #dbeafe;
    color: #1e40af;
}

.policy-type-badge.memo {
    background: #f3e8ff;
    color: #7c3aed;
}

.policy-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.policy-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.policy-section h5 {
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.policy-section h5 i {
    color: #2563eb;
    font-size: 1rem;
}

.policy-content {
    color: #374151;
    line-height: 1.6;
    font-size: 0.95rem;
}

.policy-content ul, .policy-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.policy-content li {
    margin-bottom: 5px;
}

.policy-content strong {
    color: #1f2937;
    font-weight: 600;
}

.no-drafts {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.policy-preview h4 {
    color: #1f2937;
    margin-bottom: 15px;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 8px;
}

.policy-preview .preview-section {
    margin-bottom: 15px;
}

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

.policy-preview .preview-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.policy-preview .preview-content {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: bold;
}

.footer-logo i {
    font-size: 1.5rem;
}

/* Mobile App Layout Styles */
.app-pages {
    display: none;
    min-height: calc(100vh - 70px);
    padding-top: 70px;
    padding-bottom: 70px;
}

.app-page {
    display: none;
    min-height: calc(100vh - 140px);
    padding: 20px;
    background: #f8fafc;
}

.app-page.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.app-page-header {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.app-page-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-page-header h2 i {
    color: #667eea;
}

.app-page-content {
    padding: 0;
}

.policies-container-mobile,
.add-policy-container-mobile,
.advisor-container-mobile,
.profile-container-mobile {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: none;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 8px 0;
    max-height: 70px;
}

.bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    gap: 4px;
}

.bottom-nav-btn i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.bottom-nav-btn span {
    font-size: 0.7rem;
    font-weight: 500;
}

.bottom-nav-btn.active {
    color: #667eea;
}

.bottom-nav-btn:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Hide desktop navbar on mobile */
    .navbar {
        display: none !important;
    }
    
    /* Show bottom nav and app pages on mobile when logged in */
    body.user-logged-in .bottom-nav {
        display: flex;
    }
    
    body.user-logged-in .app-pages {
        display: block;
    }
    
    /* Hide desktop sections on mobile when app pages are active */
    body.user-logged-in .hero,
    body.user-logged-in .policy-types,
    body.user-logged-in .organizations,
    body.user-logged-in .policies,
    body.user-logged-in .admin-section {
        display: none !important;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .policy-grid {
        grid-template-columns: 1fr;
    }
    
    .organization-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .policies-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 150px 0 80px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .policy-types,
    .organizations,
    .policies,
    .admin-section {
        padding: 60px 0;
    }
    
    .policy-types h2,
    .organizations h2,
    .policies h2,
    .admin-section h2 {
        font-size: 2rem;
    }
}


/* Survey Steps */
.survey-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.survey-step.active {
    display: block;
}

.survey-step h4 {
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.checkbox-group label:hover {
    background-color: #f3f4f6;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

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


/* Export Button Styles */
.btn-success {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-success:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-info {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-info:hover {
    background-color: #0056b3;
    border-color: #004085;
}

/* Password Modal Styles */
.password-form {
    max-width: 400px;
    margin: 0 auto;
}

.password-form .form-group {
    margin-bottom: 20px;
}

.password-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.password-form input[type="password"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Admin Dashboard Styles */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card span {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
    display: block;
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.admin-actions .btn {
    flex: 1;
    min-width: 200px;
}

.draft-management {
    margin-top: 30px;
}

.draft-management h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

.no-drafts {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin: 2px;
}

.btn-small i {
    margin-right: 4px;
}

/* AI Toggle Styles */
.ai-options {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ai-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 8px;
}

.ai-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    position: relative;
    transition: background-color 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ai-toggle input[type="checkbox"]:checked + .toggle-slider {
    background-color: #28a745;
}

.ai-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-label {
    font-weight: 600;
    color: #495057;
}

.ai-mode-info {
    margin-top: 5px;
    padding-left: 60px;
}

.ai-mode-info small {
    font-size: 12px;
    color: #6c757d;
}

/* Chat Interface Styles */
.chat-modal .modal-content {
    max-width: 800px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: #007bff;
    color: white;
}

.user-message .message-avatar {
    background: #28a745;
    color: white;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    margin-right: 0;
    margin-left: 12px;
}

.message-content {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-message .message-content {
    background: #e3f2fd;
}

.message-content p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.quick-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quick-options .btn {
    font-size: 12px;
    padding: 6px 12px;
}

.chat-input-container {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
}

.chat-input input:focus {
    outline: none;
    border-color: #007bff;
}

.chat-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Responsive Chat */
@media (max-width: 768px) {
    .chat-modal .modal-content {
        height: 500px;
        max-width: 95%;
    }
    
    .quick-options {
        flex-direction: column;
    }
    
    .chat-actions {
        flex-direction: column;
    }
}

/* Settings Modal Styles */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    color: #6c757d;
    font-weight: 500;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-btn:hover {
    color: #007bff;
    background: #f8f9fa;
}

.settings-tab {
    display: none;
}

.settings-tab.active {
    display: block;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    color: #495057;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.add-item-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 20px;
    align-items: end;
}

.add-item-form input,
.add-item-form select {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}

.add-item-form input:focus,
.add-item-form select:focus {
    outline: none;
    border-color: #007bff;
}

.items-list {
    display: grid;
    gap: 15px;
}

.item-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.item-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.item-info h4 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 16px;
}

.item-info p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.severity-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-minor {
    background: #d4edda;
    color: #155724;
}

.severity-moderate {
    background: #fff3cd;
    color: #856404;
}

.severity-major {
    background: #f8d7da;
    color: #721c24;
}

.severity-severe {
    background: #f5c6cb;
    color: #721c24;
}

.form-help {
    color: #666;
    font-size: 0.8rem;
    margin-top: 5px;
}

.login-help {
    text-align: center;
    margin-top: 15px;
    color: #666;
}

.login-help a {
    color: #007bff;
    text-decoration: none;
}

.login-help a:hover {
    text-decoration: underline;
}

.admin-modal-content {
    max-width: 900px;
}

.settings-modal-content {
    max-width: 1000px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

.stat-card i {
    font-size: 2rem;
    color: #007bff;
    margin-bottom: 10px;
}

.stat-card h3 {
    font-size: 2rem;
    margin: 10px 0;
    color: #333;
}

.stat-card p {
    color: #666;
    margin: 0;
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.user-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.user-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.user-role {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 10px;
}

.user-role.admin {
    background: #dc3545;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.no-items {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.api-config {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.api-config .form-group {
    margin-bottom: 15px;
}

.api-config .form-group:last-child {
    margin-bottom: 0;
}

.api-config .btn {
    margin-right: 10px;
    margin-bottom: 10px;
}

.api-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.api-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.api-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.api-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Settings Tabs Styles */
.settings-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #f8f9fa;
}

.settings-tab {
    display: none;
}

.settings-tab.active {
    display: block;
}


/* Profile Center Styles */
.profile-modal-content {
    max-width: 800px;
    width: 90%;
}

.profile-section {
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.profile-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.profile-info p {
    color: #666;
    margin-bottom: 0.5rem;
}

.profile-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.profile-status.active {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.profile-status.inactive {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.profile-tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #6c757d;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.profile-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.profile-tab {
    display: none;
}

.profile-tab.active {
    display: block;
}

.profile-tab h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 500;
    color: #666;
    font-size: 0.875rem;
}

.info-item span {
    color: #333;
    font-weight: 500;
}

.security-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preference-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preference-item {
    display: flex;
    align-items: center;
}

.preference-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.preference-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}

/* User Profile Link Styling */
.user-profile-link {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white !important;
    border-radius: 20px;
    padding: 0.5rem 1rem !important;
    margin-left: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.user-profile-link:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}


/* Success Message Animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.success-message {
    animation: slideIn 0.3s ease-out;
}


/* Organization and Disciplinary Action Toggle Styles */
.organization-selection,
.disciplinary-selection {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.organization-toggles,
.disciplinary-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.toggle-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-item:hover {
    background-color: #f1f5f9;
    border-color: #3b82f6;
}

.toggle-item input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.toggle-label {
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.action-description {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 2px;
}

.custom-disciplinary {
    margin-top: 15px;
}

.custom-disciplinary textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    resize: vertical;
}

.custom-disciplinary textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


/* Policy Type Selection Styles */
.policy-type-selection {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.policy-type-selection h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

.policy-type-toggles {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.policy-type-toggles .toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.policy-type-toggles .toggle-item:hover {
    background-color: #f1f5f9;
    border-color: #3b82f6;
}

.policy-type-toggles .toggle-item input[type="radio"] {
    margin: 0;
    transform: scale(1.2);
}

.policy-type-toggles .toggle-item input[type="radio"]:checked + .toggle-label {
    color: #3b82f6;
    font-weight: 600;
}

.policy-type-toggles .toggle-label {
    font-weight: 500;
    color: #374151;
    margin: 0;
    cursor: pointer;
}


/* Policy Options Selection Styles */
.policy-options-selection {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.policy-options-selection h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

.policy-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.option-group {
    background-color: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.option-group h5 {
    margin: 0 0 10px 0;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
}

.organization-toggles,
.responsibility-toggles,
.disciplinary-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-description,
.action-description {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

.empty-state {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

@media (min-width: 768px) {
    .policy-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* Policy Editing Styles */
.editable-section {
    position: relative;
    transition: all 0.3s ease;
}

.editable-content {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    padding: 10px;
    min-height: 40px;
}

.editable-content:hover {
    background-color: #f8f9fa;
    border: 2px dashed #007bff;
}

.editable-content.editing {
    background-color: #fff;
    border: 2px solid #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

.edit-actions {
    margin-top: 10px;
    text-align: right;
}

.edit-actions .btn {
    margin-left: 5px;
}

.editable-content:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Make it clear that content is editable */
.editable-section::before {
    content: "✏️ Click to edit";
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 12px;
    color: #6c757d;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.editable-section:hover::before {
    opacity: 1;
}

.editable-content.editing + .edit-actions {
    display: block !important;
}


/* Policy Info Header Styling */
.policy-info-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.policy-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.summary-item i {
    font-size: 16px;
    opacity: 0.9;
}

.summary-item span {
    line-height: 1.4;
}

/* Clean up policy preview */
.policy-preview.professional {
    border-radius: 0 0 12px 12px;
    margin-top: 0;
}


/* AI Modal Improvements */
.ai-subtitle {
    color: #6c757d;
    font-size: 14px;
    margin: 5px 0 0 0;
    font-weight: 400;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.policy-type-selection {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.policy-type-selection h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
}

.policy-options-selection {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.policy-options-selection h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
}

.policy-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.option-group {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.option-group h5 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.toggle-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.toggle-item:last-child {
    margin-bottom: 0;
}

.toggle-label {
    margin-left: 8px;
    font-size: 14px;
    color: #495057;
}

.role-description,
.action-description {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

/* Policy Upload Styles */
.upload-container {
    max-width: 100%;
    margin: 0 auto;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-area.drag-over {
    border-color: #667eea;
    background: #e6fffa;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-area h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: #718096;
    margin-bottom: 1.5rem;
}

.upload-info {
    margin-top: 1rem;
    color: #a0aec0;
    font-size: 0.875rem;
}

/* Processing Status */
.processing-status {
    margin: 2rem 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.processing-content h3 {
    color: #2d3748;
    margin: 1rem 0 0.5rem;
}

.processing-content p {
    color: #718096;
    margin-bottom: 1rem;
}

.processing-icon {
    font-size: 3rem;
    color: #667eea;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Uploaded Files */
.uploaded-files {
    margin: 2rem 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.uploaded-files h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.file-list {
    display: grid;
    gap: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    width: 48px;
    height: 48px;
    background: #667eea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.file-details h4 {
    color: #2d3748;
    margin: 0 0 0.25rem 0;
}

.file-details p {
    color: #718096;
    margin: 0;
    font-size: 0.875rem;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.processing {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Analysis Results */
.analysis-results {
    margin: 2rem 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.analysis-results h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.analysis-content {
    display: grid;
    gap: 1.5rem;
}

.analysis-item {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.analysis-item h4 {
    color: #2d3748;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-item h4 i {
    color: #667eea;
}

.analysis-field {
    margin-bottom: 1rem;
}

.analysis-field label {
    display: block;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.analysis-field .field-value {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    color: #2d3748;
    min-height: 40px;
}

.policy-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.policy-type-badge.admin {
    background: #dbeafe;
    color: #1e40af;
}

.policy-type-badge.sog {
    background: #fce7f3;
    color: #9f1239;
}

.policy-type-badge.memo {
    background: #fef3c7;
    color: #92400e;
}

.analysis-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Loading Overlay for n8n Automation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-content {
    background: white;
    padding: 3rem 4rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
    border-top-color: #667eea;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #764ba2;
    width: 75%;
    height: 75%;
    top: 12.5%;
    left: 12.5%;
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: #f093fb;
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
}

.spinner-ring:nth-child(4) {
    border-top-color: #4facfe;
    width: 25%;
    height: 25%;
    top: 37.5%;
    left: 37.5%;
}

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

.loading-content h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.loading-content p {
    color: #718096;
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
}

.loading-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5rem 0 1rem 0;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-file-name {
    color: #a0aec0;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Notification Center Styles */
.notification-dropdown {
    position: relative;
    display: inline-block;
}

.notification-dropdown .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid white;
    transform: translate(50%, -50%);
}

.notification-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    min-width: 320px;
    max-width: 400px;
    margin-top: 10px;
    z-index: 1000;
    border: 1px solid #e5e7eb;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-content {
    flex: 1;
}

.notification-content p {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.notification-time {
    font-size: 11px;
    color: #9ca3af;
}

.no-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}
