/* ============================================
   OKTA LOG GENERATOR - Page-specific styles
   ============================================ */

/* Hero Header */
.hero {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    padding: 48px 32px 32px;
    text-align: center;
    border-bottom: 1px solid #30363d;
}

.hero h1 {
    color: #ffffff;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    color: #c9d1d9;
    font-size: 20px;
}

/* Sticky Control Bar */
.control-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #30363d;
    padding: 20px 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.control-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label {
    color: #c9d1d9;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.control-bar select,
.control-bar input[type="number"] {
    padding: 10px 14px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 14px;
    background: #0d1117;
    color: #ffffff;
    min-width: 180px;
    transition: all 0.2s;
}

.control-bar select:focus,
.control-bar input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.control-bar input[type="number"] {
    min-width: 100px;
}

.generate-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.generate-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.generate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.info-toggle {
    background: transparent;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.info-toggle:hover {
    background: #21262d;
    border-color: #6e7681;
}

/* Expandable Info Panel */
.info-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-bottom: 0;
}

.info-panel.expanded {
    max-height: 1200px;
    margin-bottom: 32px;
}

.info-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.info-card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 24px;
    transition: all 0.2s;
}

.info-card:hover {
    border-color: #6e7681;
    transform: translateY(-2px);
}

.info-card h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card p {
    color: #c9d1d9;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.info-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
}

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

/* Environment Config Section */
.env-section {
    margin-top: 24px;
}

.env-json-container {
    background: #0d1117;
    border-radius: 8px;
    padding: 20px;
    max-height: 400px;
    overflow: auto;
    border: 1px solid #30363d;
    margin-top: 16px;
}

.env-json-container::-webkit-scrollbar {
    width: 8px;
}

.env-json-container::-webkit-scrollbar-track {
    background: #161b22;
}

.env-json-container::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.env-json-container pre {
    margin: 0;
    color: #c9d1d9;
    font-size: 13px;
    line-height: 1.6;
    font-family: 'SF Mono', Monaco, monospace;
}

.env-copy-btn {
    background: transparent;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.env-copy-btn:hover {
    background: #21262d;
    border-color: #6e7681;
}

.env-copy-btn.copied {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* Stats Section */
.stats-section {
    margin-bottom: 32px;
}

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

.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #6e7681;
    transform: translateY(-2px);
}

.stat-label {
    color: #c9d1d9;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.stat-value {
    color: #ffffff;
    font-size: 44px;
    font-weight: 700;
}

/* Logs Section */
.logs-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 32px;
}

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

.logs-header h2 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
}

.download-logs-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-logs-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.download-logs-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.logs-container {
    background: #0d1117;
    border-radius: 8px;
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #30363d;
}

pre {
    color: #c9d1d9;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: #6e7681;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    color: #c9d1d9;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* Floating Vote Badge */
.vote-badge {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.vote-badge:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.vote-badge-icon {
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.vote-badge-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

/* Voting Panel Backdrop */
.vote-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(4px);
}

.vote-panel-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Voting Panel */
.vote-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    background: #0d1117;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid #30363d;
}

.vote-panel.active {
    right: 0;
}

.vote-panel-header {
    position: sticky;
    top: 0;
    background: #161b22;
    padding: 24px 32px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.vote-panel-header h3 {
    color: #ffffff;
    font-size: 24px;
    margin: 0;
    font-weight: 700;
}

.vote-panel-close {
    background: transparent;
    color: #c9d1d9;
    border: 1px solid #30363d;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.vote-panel-close:hover {
    background: #21262d;
    border-color: #6e7681;
}

.vote-panel-content {
    padding: 32px;
}

.vote-panel-intro {
    color: #c9d1d9;
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 1.6;
}

/* Vote Cards */
.vote-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.vote-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
}

.vote-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
}

.vote-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.vote-card h4 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.vote-count {
    background: #21262d;
    color: #3b82f6;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
}

.vote-description {
    color: #c9d1d9;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.vote-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vote-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.4);
}

.vote-btn:disabled {
    background: #30363d;
    color: #6e7681;
    cursor: not-allowed;
    transform: none;
}

.vote-btn.voted {
    background: #10b981;
    pointer-events: none;
}

.vote-icon {
    font-size: 20px;
}

.vote-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    padding: 12px 18px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.log-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Searchable Select */
.select-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 14px;
    background: #0d1117;
    color: #ffffff;
    cursor: text;
}

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

.options-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-top: 4px;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.options-container.show {
    display: block;
}

.option-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #30363d;
    overflow: hidden;
}

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

.option-item:hover {
    background: #21262d;
}

.option-item.selected {
    background: rgba(59, 130, 246, 0.15);
}

.option-title {
    color: #f0f6fc;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    word-wrap: break-word;
    white-space: normal;
}

.option-description {
    color: #c9d1d9;
    font-size: 12px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #c9d1d9;
    font-size: 14px;
}

/* Graph Container */
.graph-container {
    background: #0d1117;
    border-radius: 8px;
    padding: 20px;
    min-height: auto;
    max-height: none;
    overflow: visible;
    border: 1px solid #30363d;
    display: block;
    position: relative;
    transition: all 0.3s ease;
}

.graph-container.collapsed {
    min-height: 60px;
    max-height: 60px;
    overflow: hidden;
}

.graph-container.expanded {
    min-height: 350px;
    max-height: 600px;
    overflow: auto;
}

.graph-toggle {
    position: absolute;
    top: 16px;
    right: 20px;
    background: transparent;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.graph-toggle:hover {
    background: #21262d;
    border-color: #6e7681;
}

.graph-container::before {
    content: attr(data-title);
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    padding-bottom: 8px;
    padding-right: 100px;
    border-bottom: 1px solid #30363d;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.graphs-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Graph Loading State */
.graph-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #8b949e;
}

.graph-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #30363d;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.graph-loading p {
    font-size: 14px;
    color: #8b949e;
}

.graph-tab.active {
    opacity: 0.5;
    cursor: default;
}

/* Force white title text inside rendered Graphviz SVGs */
.graph-container svg text {
    fill: #ffffff !important;
}

/* Graph Legend Styling */
.graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 32px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c9d1d9;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Graph Section Styling */
.graphs-section {
    margin-bottom: 40px;
}

.graphs-header {
    margin-bottom: 20px;
}

.graphs-header h2 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.distribution-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.distribution-toggle:hover {
    background: #21262d;
    border-color: #6e7681;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero .subtitle {
        font-size: 16px;
    }

    .control-bar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .control-bar select,
    .control-bar input[type="number"],
    .generate-btn,
    .info-toggle {
        width: 100%;
        min-width: auto;
    }

    .info-toggle {
        margin-left: 0;
    }

    .vote-panel {
        max-width: 100%;
        right: -100%;
    }

    .vote-badge {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .graph-legend {
        gap: 12px;
        padding: 16px;
    }

    .legend-item {
        font-size: 13px;
    }
}

/* Details Element Styling */
details[open] summary span:first-child {
    transform: rotate(90deg);
}