/* Athena Protocol - Enhanced Styles for Trust-as-a-Service Platform */

/* Custom CSS Variables for Athena Protocol */
:root {
    --athena-primary: #2563eb;
    --athena-primary-dark: #1d4ed8;
    --athena-secondary: #64748b;
    --athena-accent: #10b981;
    --athena-warning: #f59e0b;
    --athena-error: #ef4444;
    --athena-success: #10b981;
    --athena-trust-verified: #059669;
    --athena-trust-blockchain: #3b82f6;
    --athena-trust-basic: #d97706;
    --athena-trust-none: #6b7280;
    --athena-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --athena-gradient-trust: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --athena-gradient-blockchain: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    --athena-shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --athena-shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --athena-shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base reset and typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #334155;
    background-color: #f8fafc;
}

/* Enhanced button system */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn:hover:before {
    left: 100%;
}

.btn-primary {
    background: var(--athena-gradient-primary);
    color: white;
    box-shadow: var(--athena-shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--athena-shadow-medium);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-success {
    background: var(--athena-gradient-trust);
    color: white;
}

.btn-trust {
    background: var(--athena-gradient-trust);
    color: white;
    position: relative;
}

.btn-trust::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="white" d="M12 2L13.09 8.26L20 9L13.09 9.74L12 16L10.91 9.74L4 9L10.91 8.26L12 2Z"/></svg>');
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: right 8px center;
    pointer-events: none;
}

.btn-blockchain {
    background: var(--athena-gradient-blockchain);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Enhanced trust badges */
.trust-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.trust-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.trust-verified {
    background: var(--athena-gradient-trust);
    color: white;
}

.trust-blockchain {
    background: var(--athena-gradient-blockchain);
    color: white;
}

.trust-basic {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.trust-none {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: white;
}

/* SOP Status indicators */
.sop-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.sop-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

.sop-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.sop-pending::before {
    background: #9ca3af;
}

.sop-in-progress {
    background: #fef3c7;
    color: #92400e;
}

.sop-in-progress::before {
    background: #f59e0b;
}

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

.sop-completed::before {
    background: #10b981;
}

.sop-failed {
    background: #fee2e2;
    color: #991b1b;
}

.sop-failed::before {
    background: #ef4444;
}

/* Enhanced card system */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--athena-shadow-soft);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--athena-shadow-medium);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.card-body {
    padding: 1.5rem;
}

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

/* Trust dashboard specific styles */
.trust-dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
}

.trust-dashboard .card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.trust-metric-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    color: white;
}

.trust-metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Blockchain verification styles */
.blockchain-verification {
    background: var(--athena-gradient-blockchain);
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
}

.blockchain-verification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="blockchain-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><rect x="0" y="0" width="20" height="20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23blockchain-pattern)"/></svg>');
    opacity: 0.1;
    pointer-events: none;
}

.blockchain-hash {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    word-break: break-all;
}

/* Enhanced modal system */
.modal-container {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(8px);
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--athena-shadow-large);
    width: 100%;
    max-width: 64rem;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.modal-close {
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Enhanced navigation */
.navigation {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item {
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 50%;
    height: 2px;
    background: white;
    transform: translateX(-50%);
}

/* Publisher card enhancements */
.publisher-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--athena-shadow-soft);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.publisher-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--athena-gradient-primary);
}

.publisher-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--athena-shadow-large);
}

.publisher-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.publisher-stat {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
}

.publisher-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--athena-primary);
}

.publisher-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Article display enhancements */
.article-container {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--athena-shadow-soft);
    overflow: hidden;
}

.article-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 2rem;
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #64748b;
    font-size: 0.875rem;
}

.article-content {
    padding: 2rem;
    line-height: 1.7;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: #475569;
}

.article-content code {
    background: #f1f5f9;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.875rem;
}

.article-content pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content blockquote {
    border-left: 4px solid var(--athena-primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #64748b;
    font-style: italic;
}

/* Loading and transition effects */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--athena-primary);
    animation: spin 1s linear infinite;
}

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

/* Notification system */
.notification {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--athena-shadow-medium);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.notification-success {
    border-left-color: var(--athena-success);
}

.notification-error {
    border-left-color: var(--athena-error);
}

.notification-info {
    border-left-color: var(--athena-primary);
}

.notification-warning {
    border-left-color: var(--athena-warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Sidebar Layout Styles */
.sidebar-open {
    overflow: hidden;
}

.sidebar-transition {
    transition: transform 0.3s ease-in-out;
}

.sidebar-overlay {
    transition: opacity 0.3s ease-in-out;
}

/* Mobile responsive adjustments */
@media (max-width: 1024px) {
    .sidebar-mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
    }
    
    .sidebar-mobile {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .sidebar-mobile.open {
        transform: translateX(0);
    }
}

@media (min-width: 1024px) {
    .sidebar-desktop {
        position: static;
        transform: translateX(0);
    }
}

/* Header improvements */
.header-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
}

/* Status indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    transition: background-color 0.2s ease-in-out;
}

.status-indicator:hover {
    background-color: #f1f5f9;
}

/* Navigation improvements */
.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: #475569;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.nav-link.active {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.nav-link i {
    margin-right: 0.75rem;
    color: #94a3b8;
    transition: color 0.2s ease-in-out;
}

.nav-link.active i {
    color: #2563eb;
}

/* Sidebar content area */
.sidebar-content {
    border-top: 1px solid #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* User info section */
.user-info {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

/* Responsive main content */
.main-content {
    transition: margin-left 0.3s ease-in-out;
}

@media (min-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
}

/* File navigation improvements */
.file-nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease-in-out;
    text-decoration: none;
    color: #475569;
}

.file-nav-item:hover {
    background-color: #f1f5f9;
}

.file-nav-item.active {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.file-nav-item i {
    margin-right: 0.5rem;
    color: #94a3b8;
}

.file-nav-item.active i {
    color: #2563eb;
}

/* Enhanced dropdowns */
.dropdown-menu {
    position: absolute;
    right: 0;
    margin-top: 0.5rem;
    width: 14rem;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0;
    z-index: 50;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #475569;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.dropdown-item i {
    margin-right: 0.75rem;
    color: #94a3b8;
}

/* Badge improvements */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.badge-success {
    background-color: #d1fae5;
    color: #059669;
}

.badge-warning {
    background-color: #fef3c7;
    color: #d97706;
}

/* Mobile menu improvements */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-menu-button {
        display: block;
    }
    
    .header-brand {
        font-size: 1.125rem;
    }
}

/* Animation utilities */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out forwards;
}

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

.slide-in-left {
    transform: translateX(-100%);
    animation: slideInLeft 0.3s ease-in-out forwards;
}

@keyframes slideInLeft {
    to {
        transform: translateX(0);
    }
}

.slide-out-left {
    transform: translateX(0);
    animation: slideOutLeft 0.3s ease-in-out forwards;
}

@keyframes slideOutLeft {
    to {
        transform: translateX(-100%);
    }
}

/* Enhanced focus states */
.focus-ring {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus-ring:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    .sidebar,
    .header,
    .dropdown-menu,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* Sidebar toggle button - ensure visibility */
#sidebar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #475569;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#sidebar-toggle:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#sidebar-toggle:active {
    transform: translateY(1px);
}

/* Ensure hamburger icon is visible */
#sidebar-toggle i {
    font-size: 1.25rem;
    line-height: 1;
}

/* Hide on desktop, show on mobile */
@media (min-width: 1024px) {
    #sidebar-toggle {
        display: none !important;
    }
}
