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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #f0f6fc;
    background: #0d1117;
    min-height: 100vh;
}

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

/* Header */
header {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 3rem 0;
    text-align: center;
    color: #f0f6fc;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #f0f6fc;
}

header h1 i {
    color: #58a6ff;
    margin-right: 0.5rem;
}

header p {
    font-size: 1.1rem;
    color: #8b949e;
    font-weight: 400;
}

/* Header Navigation */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.logo-section {
    flex: 1;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #8b949e;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-link:hover {
    color: #f0f6fc;
    transform: translateY(-1px);
}

.nav-link.active {
    color: #58a6ff;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #58a6ff;
    border-radius: 1px;
}

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

.nav-text {
    transition: opacity 0.2s ease;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: #30363d;
    margin: 0 0.5rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.mobile-menu-toggle i {
    font-size: 1.2rem;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .header-nav {
        position: relative;
        width: 100%;
    }
    
    .header-nav .nav-link:not(.mobile-menu-toggle) {
        display: none;
    }
    
    .header-nav.mobile-open .nav-link:not(.mobile-menu-toggle) {
        display: flex;
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .header-nav.mobile-open {
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #161b22;
        border: 1px solid #30363d;
        border-radius: 6px;
        padding: 1rem;
        z-index: 1000;
        margin-top: 0.5rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-divider {
        display: none;
    }
    
    .nav-text {
        display: inline;
    }
    
    header {
        padding: 2rem 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #30363d;
}

.breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: #8b949e;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 0.75rem;
    color: #30363d;
    font-weight: normal;
}

.breadcrumb-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8b949e;
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-item a:hover {
    color: #58a6ff;
}

.breadcrumb-item.active {
    color: #f0f6fc;
    font-weight: 500;
}

.breadcrumb-item.active span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item i {
    font-size: 0.875rem;
}

/* Secondary Navigation */
.secondary-nav {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.secondary-nav-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.secondary-nav-label {
    color: #8b949e;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
}

.secondary-nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: #8b949e;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.secondary-nav-link:hover {
    color: #f0f6fc;
    background: #21262d;
    border-color: #30363d;
}

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

/* Quick Actions */
.quick-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.btn-floating {
    border-radius: 50px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(31, 136, 61, 0.3);
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.btn-floating:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 136, 61, 0.4);
}

.btn-floating i {
    font-size: 1.2rem;
}

.quick-action-text {
    font-size: 0.875rem;
}
.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.card:hover {
    border-color: #6e7681;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.card h2 {
    color: #f0f6fc;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.card h2 i {
    color: #58a6ff;
    margin-right: 0.5rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #30363d;
    border-radius: 6px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    background: #21262d;
}

.upload-area.dragover {
    border-color: #58a6ff;
    background: #1c2a3a;
}

.upload-area:hover {
    border-color: #58a6ff;
    background: #21262d;
}

.upload-icon {
    font-size: 3rem;
    color: #8b949e;
    margin-bottom: 1rem;
    display: block;
}

.upload-content p {
    font-size: 1rem;
    color: #f0f6fc;
    margin-bottom: 0.5rem;
}

.upload-link {
    color: #58a6ff;
    font-weight: 500;
    text-decoration: underline;
}

.upload-formats {
    font-size: 0.875rem;
    color: #8b949e;
}

/* File Info */
.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-details span {
    display: block;
    margin-bottom: 0.25rem;
}

#file-name {
    font-weight: 500;
    color: #f0f6fc;
}

#file-size {
    font-size: 0.875rem;
    color: #8b949e;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background: #1f883d;
    color: #ffffff;
    border-color: #1f883d;
}

.btn-primary:hover {
    background: #1a7c37;
    border-color: #1a7c37;
}

.btn-secondary {
    background: #0969da;
    color: #ffffff;
    border-color: #0969da;
}

.btn-secondary:hover {
    background: #0860ca;
    border-color: #0860ca;
}

.btn-outline {
    background: transparent;
    color: #f0f6fc;
    border-color: #30363d;
}

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

/* Analysis Results */
.analysis-summary {
    display: grid;
    grid-template-columns: 300px 300px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.risk-score-card {
    text-align: center;
    padding: 2rem;
    background: transparent;
    color: #f0f6fc;
    border-radius: 12px;
    border: 1px solid #30363d;
    position: relative;
}

.risk-score-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #8b949e;
}

.score-display {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #f0f6fc;
}

.risk-level {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b949e;
}

/* iOS Style Gauge */
.gauge-card {
    text-align: center;
    padding: 2rem;
    background: transparent;
    border-radius: 12px;
    border: 1px solid #30363d;
    position: relative;
}

.gauge-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #8b949e;
}

.gauge-container {
    position: relative;
    width: 240px;
    height: 160px;
    margin: 0 auto 1rem auto;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-bg {
    stroke: #21262d;
    stroke-width: 12;
    stroke-linecap: round;
}

.gauge-progress {
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-in-out;
    stroke: #3fb950; /* Default green color */
}

.gauge-value {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: #f0f6fc;
    line-height: 1;
}

.gauge-label {
    position: absolute;
    top: 88%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.gauge-min-max {
    position: absolute;
    bottom: 5px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
}

.gauge-min, .gauge-max {
    font-size: 0.875rem;
    color: #8b949e;
    font-weight: 500;
}

.gauge-definition {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #8b949e;
    line-height: 1.4;
    text-align: left;
}

.gauge-definition-title {
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 0.25rem;
}

/* Risk Summary Card */
.risk-summary-card {
    padding: 2rem;
    background: transparent;
    border-radius: 12px;
    border: 1px solid #30363d;
    text-align: left;
}

.risk-summary-card h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #8b949e;
}

.risk-summary-content {
    color: #f0f6fc;
    font-size: 0.875rem;
    line-height: 1.6;
}

.risk-summary-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #30363d;
}

.risk-summary-stat:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stat-label {
    color: #8b949e;
    font-size: 0.875rem;
}

.stat-value {
    font-weight: 600;
    color: #f0f6fc;
}

.stat-value.critical { color: #f85149; }
.stat-value.high { color: #d29922; }
.stat-value.medium { color: #58a6ff; }
.stat-value.low { color: #3fb950; }

/* Application Details Card */
.application-details-card {
    padding: 2rem;
    background: transparent;
    border-radius: 12px;
    border: 1px solid #30363d;
    text-align: left;
}

.application-details-card h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #8b949e;
}

.application-details-content {
    color: #f0f6fc;
    font-size: 0.875rem;
    line-height: 1.6;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #30363d;
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-label {
    color: #8b949e;
    font-size: 0.875rem;
    font-weight: 500;
}

.detail-value {
    font-weight: 400;
    color: #f0f6fc;
    margin-top: 0.25rem;
}

.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    padding: 1.5rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.result-card h3 {
    color: #f0f6fc;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.result-card h3 i {
    color: #58a6ff;
    margin-right: 0.5rem;
}

.result-card h3 .collapse-toggle {
    color: #8b949e;
    transition: transform 0.2s ease;
}

.result-card.collapsed .collapse-toggle {
    transform: rotate(-90deg);
}

.results-list {
    max-height: none;
    overflow: visible;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.result-card.collapsed .results-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

/* Tabbed Interface */
.results-tabs {
    display: flex;
    border-bottom: 1px solid #30363d;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
}

.tab-button:hover {
    color: #f0f6fc;
    background: #21262d;
}

.tab-button.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* Compact Results View */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    text-align: center;
    padding: 1rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.summary-card .metric-value {
    font-size: 2rem;
    font-weight: 600;
    color: #f0f6fc;
    display: block;
}

.summary-card .metric-label {
    font-size: 0.875rem;
    color: #8b949e;
    margin-top: 0.25rem;
}

.summary-card.critical .metric-value { color: #f85149; }
.summary-card.high .metric-value { color: #d29922; }
.summary-card.medium .metric-value { color: #58a6ff; }
.summary-card.low .metric-value { color: #3fb950; }

.permission-item, .csf-item, .risk-item, .recommendation-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    background: #161b22;
    border: 1px solid #30363d;
    border-left: 3px solid transparent;
}

.permission-item.high, .risk-item.high {
    border-left-color: #f85149;
    background: #2d1517;
    border-color: #da3633;
}

.permission-item.medium, .risk-item.medium {
    border-left-color: #d29922;
    background: #2e2619;
    border-color: #bf8700;
}

.permission-item.low, .risk-item.low {
    border-left-color: #3fb950;
    background: #1a2f23;
    border-color: #238636;
}

.permission-item.critical, .risk-item.critical {
    border-left-color: #da3633;
    background: #2d1517;
    border-color: #da3633;
    font-weight: 600;
}

.csf-item {
    border-left-color: #58a6ff;
    background: #1c2a3a;
    border-color: #1c7ed6;
}

.csf-controls, .csf-remediation {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #21262d;
    border-radius: 6px;
    border: 1px solid #30363d;
}

.csf-controls ul, .csf-remediation ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.csf-controls li, .csf-remediation li {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: #8b949e;
}

.csf-controls strong, .csf-remediation strong {
    color: #f0f6fc;
    font-size: 0.875rem;
}

.recommendation-item {
    border-left-color: #a5a5fc;
    background: #2a2a3c;
    border-color: #6e40c9;
}

.item-title {
    font-weight: 500;
    color: #f0f6fc;
    margin-bottom: 0.25rem;
}

.item-description {
    font-size: 0.875rem;
    color: #8b949e;
    line-height: 1.5;
}

.item-score {
    font-weight: 500;
    float: right;
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    color: white;
}

.score-high { background: #cf222e; }
.score-medium { background: #fb8500; }
.score-low { background: #1a7f37; }
.score-critical { background: #82071e; }

/* Permission Type Styles */
.permission-types {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #8b949e;
}

.permission-types strong {
    color: #f0f6fc;
}

.permission-types.app-only {
    color: #ff9800;
}

.permission-types.delegated-only {
    color: #4caf50;
}

.permission-types.both-types {
    color: #2196f3;
}

.consent-type {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
}

.permission-impact {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #8b949e;
    line-height: 1.4;
}

.permission-impact strong {
    color: #f0f6fc;
}

/* Action Buttons */
.action-buttons {
    text-align: center;
    border-top: 1px solid #30363d;
    padding-top: 2rem;
}

.action-buttons .btn {
    margin: 0 0.5rem;
}

/* Footer */
footer {
    background: #161b22;
    border-top: 1px solid #30363d;
    color: #f0f6fc;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer a {
    color: #58a6ff;
    text-decoration: none;
}

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

/* Sample Project Plans Grid */
.sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.sample-card {
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    position: relative;
}

.sample-card:hover {
    border-color: #58a6ff;
    background: #1c2a3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.15);
}

.sample-card.sample-selected {
    border-color: #3fb950;
    background: #1a2f1a;
    box-shadow: 0 4px 16px rgba(63, 185, 80, 0.2);
}

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

.sample-icon {
    font-size: 1.5rem;
    color: #58a6ff;
    margin-right: 1rem;
    flex-shrink: 0;
}

.sample-info h3 {
    color: #f0f6fc;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.sample-format {
    color: #8b949e;
    font-size: 0.875rem;
    font-weight: 400;
}

.sample-description {
    color: #8b949e;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.sample-permissions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.permission-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permission-badge.critical {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.permission-badge.high {
    background: rgba(255, 142, 78, 0.15);
    color: #ff8e4e;
    border: 1px solid rgba(255, 142, 78, 0.3);
}

.permission-badge.medium {
    background: rgba(255, 212, 59, 0.15);
    color: #ffd43b;
    border: 1px solid rgba(255, 212, 59, 0.3);
}

.permission-badge.low {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.sample-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #30363d;
}

.sample-footer p {
    color: #8b949e;
    margin-bottom: 0.5rem;
}

.sample-footer strong {
    color: #f0f6fc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .analysis-summary {
        grid-template-columns: 1fr;
    }
    
    .gauge-container {
        width: 200px;
        height: 140px;
    }
    
    .gauge-value {
        font-size: 2rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .action-buttons .btn {
        display: block;
        margin: 0.5rem 0;
        width: 100%;
    }
    
    .file-info {
        flex-direction: column;
        text-align: center;
    }
    
    .file-info .btn {
        margin-top: 1rem;
    }
    
    /* Mobile Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .breadcrumb-item:not(:last-child)::after {
        margin: 0 0.5rem;
    }
    
    /* Mobile Secondary Navigation */
    .secondary-nav-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .secondary-nav-label {
        margin-bottom: 0.5rem;
    }
    
    /* Mobile Quick Actions */
    .quick-actions {
        bottom: 1rem;
        right: 1rem;
    }
    
    .btn-floating {
        padding: 0.75rem 1rem;
    }
    
    .quick-action-text {
        display: none;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.3s ease-out;
}

/* Loading state */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(88, 166, 255, 0.2);
    border-radius: 50%;
    border-top-color: #58a6ff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Print styles for PDF generation */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    .card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    .action-buttons {
        display: none !important;
    }
}

/* Templates Page Styles */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.template-card {
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.5rem;
    transition: all 0.15s ease-in-out;
}

.template-card:hover {
    border-color: #58a6ff;
    box-shadow: 0 3px 12px rgba(88, 166, 255, 0.1);
}

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

.template-icon {
    font-size: 2rem;
    color: #58a6ff;
}

.template-info h3 {
    margin: 0;
    color: #f0f6fc;
    font-size: 1.1rem;
    font-weight: 600;
}

.template-format {
    font-size: 0.85rem;
    color: #8b949e;
    font-weight: 400;
}

.template-description {
    color: #c9d1d9;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.template-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.templates-info {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #30363d;
}

.templates-info h3 {
    color: #f0f6fc;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

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

.info-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.25rem;
}

.info-card h4 {
    color: #58a6ff;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.info-card p {
    color: #c9d1d9;
    margin: 0;
    line-height: 1.5;
}

.templates-help {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #30363d;
}

.templates-help h3 {
    color: #f0f6fc;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.help-links {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.help-links li {
    margin-bottom: 0.5rem;
}

.help-links a {
    color: #58a6ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.help-links a::before {
    content: "→";
    color: #8b949e;
}

.help-note {
    background: #0d2636;
    border: 1px solid #1f6feb;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1.5rem;
    color: #c9d1d9;
}

.help-note strong {
    color: #58a6ff;
}

/* Responsive Design for Templates */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .template-actions {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .template-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .template-icon {
        font-size: 1.5rem;
    }
}

/* Glossary and Enhanced Report Styles */
.glossary-section {
    margin-bottom: 2rem;
}

.glossary-section h3 {
    color: #f0f6fc;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid #30363d;
    padding-bottom: 0.5rem;
}

.definition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.definition-item {
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #161b22;
}

.definition-item.critical {
    border-left: 4px solid #f85149;
    background: #2d1517;
}

.definition-item.high {
    border-left: 4px solid #d29922;
    background: #2e2619;
}

.definition-item.medium {
    border-left: 4px solid #58a6ff;
    background: #1c2a3a;
}

.definition-item.low {
    border-left: 4px solid #3fb950;
    background: #1a2f23;
}

.definition-item strong {
    color: #f0f6fc;
    display: block;
    margin-bottom: 0.5rem;
}

.definition-item p {
    color: #8b949e;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.definition-item em {
    color: #c9d1d9;
    font-size: 0.8rem;
}

.terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.term-item {
    padding: 1rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.term-item strong {
    color: #58a6ff;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.term-item p {
    color: #8b949e;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.methodology-content h4 {
    color: #f0f6fc;
    font-size: 1rem;
    margin: 1rem 0 0.5rem 0;
}

.methodology-content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: #8b949e;
}

.methodology-content li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.methodology-content strong {
    color: #f0f6fc;
}

/* Permission Summary Table */
.permission-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
}

.permission-summary-table th {
    background: #21262d;
    color: #f0f6fc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid #30363d;
}

.permission-summary-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #30363d;
    font-size: 0.875rem;
}

.permission-summary-table tr:last-child td {
    border-bottom: none;
}

.permission-summary-table tr:hover {
    background: #21262d;
}

.permission-summary-table td strong {
    color: #f0f6fc;
}

.risk-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.risk-badge.critical {
    background: #f85149;
}

.risk-badge.high {
    background: #d29922;
}

.risk-badge.medium {
    background: #58a6ff;
}

.risk-badge.low {
    background: #3fb950;
}

.permission-summary-table tr.risk-critical {
    background: rgba(248, 81, 73, 0.05);
}

.permission-summary-table tr.risk-high {
    background: rgba(210, 153, 34, 0.05);
}

.permission-summary-table tr.risk-medium {
    background: rgba(88, 166, 255, 0.05);
}

.permission-summary-table tr.risk-low {
    background: rgba(63, 185, 80, 0.05);
}

/* Enhanced Permission Display */
.permission-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.permission-risk {
    font-size: 0.875rem;
    color: #8b949e;
    font-weight: 500;
}

.ms-docs-link {
    color: #58a6ff;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #58a6ff;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.ms-docs-link:hover {
    background: #58a6ff;
    color: #0d1117;
}

.permission-description {
    color: #c9d1d9;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.risk-justification {
    padding: 0.5rem;
    background: #21262d;
    border-radius: 4px;
    margin-top: 0.5rem;
    border-left: 3px solid #58a6ff;
}

.risk-justification strong {
    color: #f0f6fc;
    font-size: 0.875rem;
}

.risk-justification {
    color: #8b949e;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Responsive Design for New Elements */
@media (max-width: 768px) {
    .definition-grid {
        grid-template-columns: 1fr;
    }
    
    .terms-grid {
        grid-template-columns: 1fr;
    }
    
    .permission-summary-table {
        font-size: 0.8rem;
    }
    
    .permission-summary-table th,
    .permission-summary-table td {
        padding: 0.5rem;
    }
    
    .permission-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ms-docs-link {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Section Headers and Empty States */
.section-header {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    border-left: 3px solid #58a6ff;
}

.section-header p {
    color: #8b949e;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.section-header strong {
    color: #f0f6fc;
}

.no-items {
    padding: 1rem;
    text-align: center;
    color: #8b949e;
    font-style: italic;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
}
