/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #065f46 0%, #059669 50%, #10b981 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(6, 95, 70, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.logo i {
    font-size: 2rem;
    color: #90ee90;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

.btn-logout {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-logout:hover {
    background-color: #c82333;
}

/* Main Content */
.main-content {
    padding: 1rem 0;
    min-height: calc(100vh - 120px);
}

/* Enhanced Card Styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(16, 185, 129, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.12);
}

.card-header {
    border-bottom: 2px solid #d1fae5;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(135deg, #059669, #10b981);
    border-radius: 1px;
}

.card-title {
    font-size: 1.6rem;
    color: #065f46;
    margin-bottom: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Enhanced Form Styles - Icon Fix */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    overflow: visible;
    min-height: 50px;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #065f46;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d1fae5;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    max-width: 100%;
    position: relative;
}

/* Simple icon positioning that stays within bounds */
.form-group i.form-icon {
    position: absolute;
    left: 1rem;
    top: calc(50% + 0.75rem);
    transform: translateY(-50%);
    color: #059669;
    z-index: 10;
    pointer-events: none;
    font-size: 1rem;
    line-height: 1;
}

/* Icon positioning for form controls - Better Containment */
.form-group.has-icon {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.form-group.has-icon .form-control {
    padding-left: 3rem;
    overflow: hidden;
    border-radius: 10px;
}

.form-group.has-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #059669;
    z-index: 5;
    pointer-events: none;
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
}

.form-control-icon {
    padding-left: 3rem !important;
    overflow: hidden;
    border-radius: 10px;
}

/* Input field wrapper to contain icons */
.input-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.input-wrapper .form-control {
    border-radius: 10px;
    overflow: hidden;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #4a7c59;
    z-index: 5;
    pointer-events: none;
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.form-control:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
    cursor: pointer;
}

.checkbox-group, .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-upload {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 2rem;
    text-align: center;
    background-color: #f9f9f9;
}

.file-upload.dragover {
    border-color: #4a7c59;
    background-color: rgba(74, 124, 89, 0.05);
}

/* Enhanced Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3d6749 0%, #5a9464 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #757d85 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #2bb64a 100%);
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #059669, #065f46);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.company-info {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
    gap: 1rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #666;
    flex-shrink: 0;
    min-width: fit-content;
}

.info-value {
    color: #333;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: right;
    flex: 1;
}

/* Progress Bar */
.progress {
    background-color: #e9ecef;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.progress-bar {
    background-color: #059669;
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Assessment Styles */
.question-section {
    margin-bottom: 3rem;
}

.section-title {
    background: linear-gradient(135deg, #059669, #065f46);
    color: white;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.question-card {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 1.5rem;
    background: white;
    margin-bottom: 1rem;
}

.question-number {
    color: #059669;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
}

.required {
    color: #dc3545;
}

/* Report Styles */
.report-header {
    background: linear-gradient(135deg, #059669, #065f46);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(#28a745 var(--score-deg), #e9ecef 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.75rem auto;
    position: relative;
}

.score-circle::before {
    content: '';
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: white;
    position: absolute;
}

.score-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
    position: relative;
    z-index: 1;
}

.report-section {
    margin-bottom: 1.5rem;
}

.section-header {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-left: 4px solid #059669;
    margin-bottom: 0.75rem;
}

.recommendations-list {
    list-style: none;
    padding: 0;
}

.recommendations-list li {
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #10b981;
    border-radius: 0 4px 4px 0;
}

.weak-areas-list {
    list-style: none;
    padding: 0;
}

.weak-areas-list li {
    background: #fff3cd;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #ffc107;
    border-radius: 0 4px 4px 0;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
.footer {
    background-color: #065f46;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
        min-height: 140px;
    }
    
    .stat-value {
        font-size: 1.5rem;
        line-height: 1.2;
        padding: 0 0.25rem;
    }
    
    .company-info-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        flex-wrap: wrap;
    }
    
    .auth-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    
    .checkbox-group, .radio-group {
        flex-direction: column;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .info-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .info-value {
        text-align: left;
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 1.3rem;
        line-height: 1.1;
    }
    
    .stat-card {
        padding: 1rem 0.8rem;
        min-height: 120px;
    }
    
    .company-info-item {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .form-control {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    .form-control-icon {
        padding-left: 2.5rem !important;
    }
    
    .form-group.has-icon i,
    .input-wrapper i {
        left: 0.8rem;
        font-size: 0.9rem;
        width: 0.9rem;
        height: 0.9rem;
    }
    
    .auth-container .input-icon-wrapper > i.fas,
    .auth-container .form-group > i.fas {
        left: 0.8rem !important;
        font-size: 0.9rem !important;
    }
    
    .auth-container .form-control-icon {
        padding-left: 2.5rem !important;
    }
    
    .auth-container .form-control {
        padding: 0.6rem 0.8rem;
        padding-left: 2.5rem;
        height: 2.5rem;
    }
}

/* Auth Page Specific Styles - Input Wrapper Approach */
.auth-container .form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.auth-container .form-label {
    margin-bottom: 0.5rem;
    display: block;
}

/* Create a wrapper for input + icon */
.auth-container .input-icon-wrapper {
    position: relative;
    display: block;
}

/* Position icons inside the input wrapper */
.auth-container .input-icon-wrapper > i.fas,
.auth-container .form-group > i.fas {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #4a7c59;
    z-index: 10;
    pointer-events: none;
    font-size: 1rem;
    line-height: 1;
}

.auth-container .form-control-icon {
    padding-left: 3rem !important;
    width: 100%;
}

.auth-container .form-control {
    border: 2px solid #e8f5e8;
    border-radius: 10px;
    height: 3rem;
    position: relative;
    width: 100%;
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a7c59;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text Utilities */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-break {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.text-nowrap {
    white-space: nowrap;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }

/* Chart Styles */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    margin: 0.75rem 0;
}

.chart-wrapper {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.chart-title {
    color: #065f46;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px solid #d1fae5;
}

.stat-item {
    text-align: center;
    padding: 1rem 0.75rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    display: block;
}

.stat-description {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

/* Chart responsive design */
@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .chart-wrapper {
        padding: 0.75rem;
    }
    
    .analytics-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-description {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .analytics-stats {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 180px;
    }
}
