/* General Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Main Container */
.container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.header-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.logo-text {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    font-size: 24px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    padding: 40px;
}

/* Input Section */
.input-section {
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    border-left: 5px solid #4f46e5;
    height: fit-content;
}

.input-section h2 {
    color: #1e293b;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group input[readonly] {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.input-group small {
    color: #6b7280;
    font-size: 11px;
    display: block;
    margin-top: 4px;
}

.time-horizon-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e5e7eb;
}

.time-horizon-section h3 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.horizon-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Results Section */
.results-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    color: #1e293b;
    font-size: 1.5rem;
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.download-btn, .preview-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn {
    background: #4f46e5;
    color: white;
}

.download-btn:hover {
    background: #3730a3;
    transform: translateY(-2px);
}

.preview-btn {
    background: #10b981;
    color: white;
}

.preview-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Video/4D Preview Section */
.video-section {
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.video-section h3 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
}

.video-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(45deg, #1e293b, #374151);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.video-placeholder {
    text-align: center;
    padding: 20px;
}

.video-placeholder h4 {
    margin-bottom: 10px;
    font-size: 24px;
}

.video-placeholder p {
    opacity: 0.8;
    margin-bottom: 20px;
}

.play-button {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin: 0 auto;
}

.play-button:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.play-button::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

/* Milestone Timeline */
.milestone-timeline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.timeline-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4f46e5;
}

.timeline-section h5 {
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.milestone-item {
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

.milestone-item:last-child {
    border-bottom: none;
}

.milestone-completed { color: #10b981; }
.milestone-pending { color: #f59e0b; }
.milestone-risk { color: #ef4444; }

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #4f46e5;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.metric-card h4 {
    color: #374151;
    font-size: 14px;
    margin-bottom: 10px;
}

.metric-card .value {
    color: #1e293b;
    font-size: 18px;
    font-weight: bold;
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.chart-wrapper {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.chart-wrapper h3 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Progress Bars */
.progress-comparison {
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.progress-comparison h3 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.progress-bars {
    display: grid;
    gap: 15px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-label {
    min-width: 80px;
    font-size: 14px;
    font-weight: 600;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.progress-planned { background: #60a5fa; }
.progress-actual { background: #4f46e5; }

.progress-percentage {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Status Alert */
.status-alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.status-alert.on-schedule {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #10b981;
}

.status-alert.delayed {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.status-alert.ahead {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Cost Breakdown */
.cost-breakdown {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    margin-bottom: 20px;
}

.cost-breakdown h3 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cost-item:last-child {
    border-bottom: none;
}

#totalCostItem {
    font-weight: bold;
    background: #e0e7ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.cost-label {
    font-size: 14px;
    color: #374151;
}

.cost-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* Risk Table */
.risk-table {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.risk-table h3 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.results-table th {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 15px 12px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.results-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.results-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.results-table tr:hover {
    background-color: #eef2ff;
    transition: background-color 0.2s ease;
}

.risk-level {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

.risk-low { background-color: #10b981; }
.risk-medium { background-color: #f59e0b; }
.risk-high { background-color: #ef4444; }
.risk-critical { background-color: #7f1d1d; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    color: #1e293b;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.modal-body {
    padding-top: 20px;
    text-align: center;
}

.modal-body img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .main-content {
        padding: 20px;
    }
    .charts-container {
        gap: 20px;
    }
    .chart-container {
        height: 250px;
    }
    .milestone-timeline {
        grid-template-columns: 1fr;
    }
    .header h1 { font-size: 2rem; }
    .header p { font-size: 1.1rem; }
}