/* Brand colors */
:root {
    --bg-primary: #fff;
    --text-primary: #25293A;
    --bg-secondary: #313445;
    --text-secondary: #000103;
    --accent-primary: #FF640D;
    --human-color: #FF3558;
    --bot-color: #923CFF;
    --shadow: rgba(0, 0, 0, 0.05);
    --footer-bg: #000000;
    --footer-text: #fff;
    --muted: #D1D5DB;
    --border: #E5E7EB;
    --bg-card: #FFFFFF;
    --card-border: #EAECEF;
    --chart-background: #FAFAFA;
    --success-glow: rgba(146, 60, 255, 0.2);
}

/* Base styles */
html, body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Custom Font for Encrypted Content */
@font-face {
    font-family: 'CipherFont';
    src: url('/font.woff') format('woff'),
         url('/font') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.encrypted-text,
[data-encrypted="true"],
.encrypted-area,
#encryptedOutput,
.diff-encrypted,
#multilingualEncryptedRendered,
#multilingualEncryptedSource,
#previewContent {
    font-family: 'CipherFont', sans-serif !important;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

.header-content {
    padding: 0;
    margin-bottom: 2rem;
    background-color: #000000;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: center;
    position: relative;
}

.header-content h1.display-4 {
    font-weight: 700;
    color: white;
    font-size: 2rem;
    margin: 0;
    padding: 15px 0;
    white-space: nowrap;
    text-align: center;
    width: 100%;
}

.header-content p.lead {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 800px;
    margin: 1rem auto 0;
}

/* Cards */
.card {
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 6px var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    background-color: var(--bg-card);
}

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

.card-header {
    background-color: var(--bg-secondary);
    color: white;
    font-weight: 600;
    border-bottom: none;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Overview card enhancement */
.overview-card {
    margin-bottom: 40px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    border: none;
}

.overview-card .card-header {
    background: linear-gradient(90deg, var(--bg-secondary) 0%, rgba(49, 52, 69, 0.85) 100%);
    padding: 1.2rem 1.5rem;
}

.overview-card .card-header h2 {
    font-weight: 600;
    letter-spacing: -0.2px;
    margin-bottom: 0;
}

.overview-card .card-body {
    padding: 2rem;
}

.overview-card .card-body p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* AI components grid layout */
.ai-components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* AI Component Sections */
.ai-component {
    display: flex;
    align-items: flex-start;
    padding: 24px;
    background-color: var(--chart-background);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.42, 0, 0.58, 1);
    border-left: 3px solid var(--accent-primary);
}

.ai-component:hover {
    transform: translateX(4px);
    background-color: #f0f0f4;
}

.ai-component-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
}

.ai-component-icon i {
    color: white;
    font-size: 18px;
}

.ai-component-content {
    flex: 1;
}

.ai-component h3 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.ai-component p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.ai-component strong {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
}

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

.btn-primary:hover, .btn-primary:focus {
    background-color: #e55700;
    border-color: #e55700;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.btn-success:hover, .btn-success:focus {
    background-color: #7e33dd;
    border-color: #7e33dd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Enhanced buttons for main actions */
.btn-lg {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 0.8rem 1.8rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.encrypt-btn, .decrypt-btn {
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.encrypt-btn:after, .decrypt-btn:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    background: linear-gradient(90deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.13) 77%, rgba(255,255,255,0.5) 92%, rgba(255,255,255,0.3) 100%);
}

.encrypt-btn:hover:after, .decrypt-btn:hover:after {
    opacity: 1;
    transform: translateX(100%);
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0.7rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 100, 13, 0.15);
}

textarea.form-control {
    min-height: 120px;
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    resize: vertical;
}

/* Enhanced textareas */
.encrypted-area {
    background-color: rgba(146, 60, 255, 0.03);
    border-color: rgba(146, 60, 255, 0.2);
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
}

/* Label enhancements */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Logo */
.logo-container {
    margin: 0 auto;
    padding: 15px;
    background-color: #000000;
    text-align: center;
    width: 180px;
}

.logo-container img {
    max-width: 150px;
    height: auto;
    margin: 0 auto;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}

footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

footer a:hover {
    color: #e55700;
    text-decoration: underline;
}

/* Footer logo */
.footer-logo {
    text-align: center;
    padding: 10px;
    background-color: #000000;
    border-radius: 8px;
    width: 170px;
    margin: 0 auto;
}

.footer-logo img {
    max-width: 150px;
    height: auto;
    margin: 0 auto;
}

/* Feature cards */
.feature-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-card .card-body {
    flex: 1;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

/* Animation for page load */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-content, .card {
    animation: fadeIn 0.5s ease-out forwards;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.2s;
}

/* AI Component animations */
.ai-component {
    animation: fadeIn 0.5s ease-out forwards;
}

.ai-component:nth-child(1) {
    animation-delay: 0.1s;
}

.ai-component:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-component:nth-child(3) {
    animation-delay: 0.3s;
}

.ai-component:nth-child(4) {
    animation-delay: 0.4s;
}

/* Highlight success animation */
@keyframes highlightSuccess {
    0% { box-shadow: 0 0 0 0 var(--success-glow); }
    70% { box-shadow: 0 0 0 10px rgba(146, 60, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(146, 60, 255, 0); }
}

.highlight-success {
    animation: highlightSuccess 1.5s ease-out;
    border-color: var(--bot-color);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .ai-components-grid {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 24px;
    }

    .logo-container {
        padding: 10px;
    }

    .logo-container img {
        max-width: 150px;
    }

    .header-content h1.display-4 {
        font-size: 1.8rem;
    }

    .footer-logo {
        padding: 8px;
        width: 150px;
    }

    .footer-logo img {
        max-width: 130px;
    }
}

@media (max-width: 768px) {
    .ai-component {
        padding: 18px;
    }

    .ai-component-icon {
        width: 32px;
        height: 32px;
    }

    .mb-3.d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .analysis-results {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .logo-container {
        padding: 8px;
    }

    .logo-container img {
        max-width: 120px;
    }

    .header-content h1.display-4 {
        font-size: 1.5rem;
        padding: 0.5rem;
    }

    .footer-logo {
        padding: 6px;
        width: 130px;
    }

    .footer-logo img {
        max-width: 110px;
    }
}

/* Action buttons enhancement */
.action-buttons {
    display: flex;
    gap: 12px;
    margin: 0;
    align-items: center;
}

/* Make Encryption Summary more prominent */
.analysis-results {
    background-color: var(--chart-background);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-right: 10px;
    max-width: 300px;
}

.analysis-results .h5 {
    color: var(--accent-primary);
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.analysis-results .list-group-item {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Make editors more distinct */
.editor {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    min-height: 300px;
    background-color: #fafafa;
    overflow-y: auto;
    margin-top: 10px;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", "Segoe UI", monospace;
}

.editor:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 100, 13, 0.15);
    background-color: white;
}

/* Segment list */
.segment-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #e9ecef;
}

.segment-item.segment-encrypt {
    border-left-color: var(--accent-primary);
    background-color: #fff8f3;
}

/* Audit Log Information Styles */
.audit-log-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    border-left: 4px solid #28a745;
}

.audit-log-info h5 {
    color: #28a745;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.audit-log-info h5 i {
    margin-right: 6px;
}

.audit-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.audit-badge.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.audit-badge.warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.audit-badge.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.audit-badge i {
    margin-right: 4px;
}

/* Animation for audit badge */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.audit-badge.success {
    animation: pulse 2s infinite;
}

/* Advanced Options Panel */
#advancedOptions .card-body {
    padding: 1.25rem;
}

#advancedOptions .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Key Management Info */
.key-management-info {
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.key-management-info h6 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.key-management-info h6 i {
    margin-right: 6px;
    color: var(--accent-primary);
}

/* Key History Items */
.key-history-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: #f8f9fa;
    border-left: 3px solid #dee2e6;
    transition: all 0.2s ease;
}

.key-history-item.active {
    border-left-color: var(--accent-primary);
    background-color: #fff8f3;
}

.key-history-item:hover {
    transform: translateX(3px);
}

/* Encryption Mode Indicator */
.encryption-mode-indicator {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
    border-left: 4px solid var(--accent-primary);
}

.encryption-mode-indicator h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.encryption-mode-indicator h5 i {
    margin-right: 6px;
    color: var(--accent-primary);
}

.gap-2 {
    gap: 0.5rem;
}

/* Encryption state indicator */
.encryption-state {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    z-index: 10;
}

.encryption-state.encrypted {
    background-color: rgba(146, 60, 255, 0.1);
    color: var(--bot-color);
}

.encryption-state.decrypted {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.encryption-state i {
    margin-right: 4px;
}

/* Toggle transition */
.toggle-transition {
    transition: opacity 0.2s ease;
}

.fade-in-content {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Comparison Container */
.comparison-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.comparison-container .form-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* Key Details */
.key-details {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
}

.current-key-info .badge {
    padding: 6px 10px;
    font-weight: 500;
}

/* Make the main content grow to push footer down */
.container-fluid {
    flex: 1 0 auto;
}

/* Tab Navigation Enhancements */
.nav-tabs .nav-link {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid transparent;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    background-color: rgba(255, 100, 13, 0.05);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--accent-primary);
    background-color: white;
    border-color: var(--border);
    border-bottom-color: transparent;
    font-weight: 600;
}

.nav-tabs .nav-link i {
    margin-right: 6px;
}
