/*
Theme Name: Law Machine
Theme URI: https://mundanecloud.com
Description: Professional legal compliance management theme for Law Machine. Features clean design optimized for legal professionals with comprehensive compliance dashboards and document management.
Version: 1.0.0
Author: Mundane Cloud
License: GPL v2 or later
Text Domain: law-machine-theme
*/

/* Force override padding-top on main content */
.main-content,
main.main-content,
.law-machine-main .main-content {
    padding-top: 0 !important;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Header Styles */
.law-machine-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.law-machine-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.law-machine-logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.law-machine-logo::before {
    content: "⚖";
    font-size: 1.8rem;
}

.law-machine-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.law-machine-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.law-machine-menu a:hover {
    opacity: 0.8;
}

/* Main Content */
.law-machine-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.law-machine-main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Dashboard Header */
.law-machine-dashboard-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.law-machine-dashboard-title {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.law-machine-dashboard-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1.1rem;
}

/* Company Selector */
.law-machine-company-selector {
    margin: 2rem 0;
    padding: 0 2rem;
}

.law-machine-select-wrapper {
    position: relative;
    display: inline-block;
    min-width: 300px;
}

.law-machine-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    color: #374151;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='5'><path fill='%23666' d='m0,1 2,0 -1,2 z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: border-color 0.2s ease;
}

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

/* Dashboard Grid */
.law-machine-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 2rem;
}

/* Stats Cards */
.law-machine-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.law-machine-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.law-machine-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.law-machine-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: #1e40af;
}

.law-machine-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.law-machine-stat-card.critical .law-machine-stat-number {
    color: #dc2626;
}

.law-machine-stat-card.warning .law-machine-stat-number {
    color: #d97706;
}

.law-machine-stat-card.success .law-machine-stat-number {
    color: #059669;
}

/* Progress Section */
.law-machine-progress-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

.law-machine-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.law-machine-progress-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.law-machine-progress-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e40af;
}

.law-machine-progress-bar {
    height: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.law-machine-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 6px;
    transition: width 0.8s ease;
}

.law-machine-progress-text {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Compliance Items */
.law-machine-items-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

.law-machine-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.law-machine-items-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.law-machine-filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.law-machine-filter-tab {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.law-machine-filter-tab.active,
.law-machine-filter-tab:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.law-machine-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.law-machine-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.law-machine-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.law-machine-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.law-machine-item-title {
    font-weight: 600;
    color: #374151;
    margin: 0;
    flex: 1;
}

.law-machine-item-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.law-machine-item-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.law-machine-item-status.in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.law-machine-item-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.law-machine-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.law-machine-item-priority {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.law-machine-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.law-machine-priority-dot.low { background: #10b981; }
.law-machine-priority-dot.medium { background: #f59e0b; }
.law-machine-priority-dot.high { background: #ef4444; }
.law-machine-priority-dot.critical { 
    background: #dc2626; 
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.law-machine-item-due {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.law-machine-item-due.overdue {
    color: #dc2626;
    font-weight: 600;
}

/* Sidebar */
.law-machine-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Next Actions Widget */
.law-machine-next-actions {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.law-machine-widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
}

.law-machine-action-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.law-machine-action-item:last-child {
    margin-bottom: 0;
}

.law-machine-action-item.urgent {
    border-color: #dc2626;
    background: #fef2f2;
}

.law-machine-action-title {
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
}

.law-machine-action-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Company Info Widget */
.law-machine-company-info {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.law-machine-company-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 0.5rem 0;
}

.law-machine-company-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.law-machine-company-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.law-machine-company-detail:last-child {
    margin-bottom: 0;
}

.law-machine-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Buttons */
.law-machine-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.law-machine-btn-primary {
    background: #3b82f6;
    color: white;
}

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

.law-machine-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.law-machine-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Footer */
.law-machine-footer {
    background: #1f2937;
    color: #9ca3af;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.law-machine-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .law-machine-nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .law-machine-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .law-machine-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .law-machine-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .law-machine-container {
        padding: 1rem;
    }
    
    .law-machine-progress-header,
    .law-machine-items-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .law-machine-item-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .law-machine-filter-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .law-machine-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .law-machine-item-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Loading and Animation States */
.law-machine-loading {
    opacity: 0.6;
    pointer-events: none;
}

.law-machine-spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Marketing Machine Style Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

/* Login Required */
.login-required {
    text-align: center;
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 100px auto;
}

.login-required h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
}

.login-required p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.login-button {
    display: inline-block;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: transform 0.2s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    color: white;
}

/* Core Documents Section */
.law-machine-core-docs-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.law-machine-core-docs-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.law-machine-core-docs-score {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: #0c4a6e;
}

.law-machine-docs-category {
    margin-bottom: 2rem;
}

.law-machine-docs-category:last-child {
    margin-bottom: 0;
}

.law-machine-docs-category h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.law-machine-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.law-machine-doc-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.law-machine-doc-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.law-machine-doc-item.available {
    border-color: #10b981;
    background: #f0fdf4;
}

.law-machine-doc-item.missing {
    border-color: #ef4444;
    background: #fef2f2;
}

.law-machine-doc-item.compliant {
    border-color: #10b981;
    background: #f0fdf4;
}

.law-machine-doc-item.needs-attention {
    border-color: #f59e0b;
    background: #fffbeb;
}

.law-machine-doc-item .doc-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.law-machine-doc-item .doc-status {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.law-machine-doc-item .doc-updated {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.law-machine-doc-item .doc-download,
.law-machine-doc-item .doc-view {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.law-machine-doc-item .doc-download:hover,
.law-machine-doc-item .doc-view:hover {
    background: #2563eb;
    color: white;
}

.law-machine-captable-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.law-machine-captable-summary .captable-stat {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #374151;
}

.law-machine-captable-summary .captable-stat:last-child {
    margin-bottom: 1.5rem;
}

.law-machine-btn {
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.law-machine-btn-primary {
    background: #3b82f6;
    color: white;
}

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

@media (max-width: 768px) {
    .law-machine-docs-grid {
        grid-template-columns: 1fr;
    }
    
    .law-machine-core-docs-section {
        padding: 1rem;
        margin-top: 1rem;
    }
}

/* Commercial Documents Section */
.law-machine-commercial-docs-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.law-machine-commercial-docs-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.law-machine-contract-overview {
    margin-bottom: 2rem;
}

.law-machine-contract-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.contract-stat {
    text-align: center;
    font-size: 0.875rem;
    color: #475569;
}

.contract-stat strong {
    display: block;
    font-size: 1.25rem;
    color: #1e293b;
    margin-top: 0.25rem;
}

.law-machine-contracts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.law-machine-contract-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.law-machine-contract-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.law-machine-contract-item.active {
    border-color: #10b981;
    background: #f0fdf4;
}

.law-machine-contract-item.expiring-soon {
    border-color: #f59e0b;
    background: #fffbeb;
}

.law-machine-contract-item.expiring-soon::before {
    content: "⚠️ Expiring Soon";
    position: absolute;
    top: -8px;
    right: 8px;
    background: #f59e0b;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.law-machine-contract-item.view-all {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.law-machine-contract-item.view-all .contract-name {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.law-machine-contract-item.view-all .contract-count {
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.contract-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.3;
}

.contract-type {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: capitalize;
    margin-bottom: 0.5rem;
}

.contract-value {
    font-weight: 600;
    color: #059669;
    margin-bottom: 0.5rem;
}

.contract-expiry {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.contract-actions {
    display: flex;
    gap: 0.5rem;
}

.law-machine-btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.law-machine-ip-summary {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.ip-category {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.ip-category:last-of-type {
    margin-bottom: 1.5rem;
    border-bottom: none;
}

.ip-stat {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.ip-detail {
    font-size: 0.875rem;
    color: #6b7280;
}

@media (max-width: 768px) {
    .law-machine-contract-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .law-machine-contracts-grid {
        grid-template-columns: 1fr;
    }
    
    .law-machine-commercial-docs-section {
        padding: 1rem;
        margin-top: 1rem;
    }
}

/* Print Styles */
@media print {
    .law-machine-header,
    .law-machine-footer,
    .law-machine-company-selector,
    .law-machine-filter-tabs {
        display: none;
    }
    
    .law-machine-main {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .law-machine-item {
        page-break-inside: avoid;
    }
}