/**
 * Internship Hour Tracking System - Stylesheet v2.0
 * Modern, clean design with improved usability
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #5c5c5e;
    background-color: #f7f9fb;
    min-height: 100vh;
    font-size: 14px;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f7f9fb;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.login-box h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #5c5c5e;
    margin-bottom: 30px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 12px;
    font-weight: 500;
    color: #5c5c5e;
}

.form-control,
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    height: 50px;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #5c5c5e;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.form-group textarea {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

.form-control:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-left-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    height: 50px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    height: auto;
}

.btn-large {
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 700;
    height: auto;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.main-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

/* Settings Panel */
.settings-panel {
    padding: 20px 30px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.settings-toggle-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 0.125rem 0.25rem rgba(102, 126, 234, 0.3);
    font-family: 'Poppins', sans-serif;
}

.settings-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(102, 126, 234, 0.4);
}

.settings-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.settings-toggle-icon.rotated {
    transform: rotate(-180deg);
}

.settings-box {
    background: #f7f9fb;
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid #667eea;
    margin-top: 15px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.settings-box.expanded {
    max-height: 500px;
    opacity: 1;
}

.settings-content {
    max-width: 600px;
}

.form-text {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.target-display {
    margin: 15px 0;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 5px;
    color: #667eea;
    font-size: 16px;
}

/* Statistics Panel */
.statistics-panel {
    padding: 30px;
    background: #f7f9fb;
    border-bottom: 1px solid #e8e8e8;
}

.statistics-panel h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #5c5c5e;
    font-weight: 700;
}

.target-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.target-info p {
    margin-bottom: 8px;
    color: #5c5c5e;
    font-size: 14px;
}

.target-info p:last-child {
    margin-bottom: 0;
}

.no-target-message {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    border-left: 5px solid #ffc107;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.no-target-message p {
    margin: 0;
    color: #5c5c5e;
    font-size: 14px;
}

/* Statistics Panel - continued */
.statistics-panel {
    padding: 30px;
    background: #f7f9fb;
    border-bottom: 1px solid #e8e8e8;
}

.statistics-panel h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #5c5c5e;
    font-weight: 700;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stat-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-value-small {
    font-size: 18px;
    font-weight: 700;
}

.stat-unit {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    color: white;
    font-weight: 700;
    font-size: 13px;
}

.progress-bar.low {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

.progress-bar.medium {
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

.progress-bar.high {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

/* Day Control Section */
.day-control-section {
    padding: 30px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

.day-control-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0.25rem 0.5rem rgba(102, 126, 234, 0.3);
}

.day-control-box h2 {
    font-size: 22px;
    margin-bottom: 15px;
    font-weight: 700;
}

.day-control-box p {
    margin-bottom: 25px;
    font-size: 15px;
    opacity: 0.95;
}

.active-day-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: left;
    backdrop-filter: blur(10px);
}

.active-day-info p {
    margin-bottom: 10px;
    font-size: 15px;
}

.active-day-info p:last-child {
    margin-bottom: 0;
}

.active-day-info strong {
    font-weight: 700;
}

/* Entries Section */
.entries-section {
    padding: 30px;
    background: #fff;
}

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

.section-header h2 {
    font-size: 20px;
    color: #5c5c5e;
    font-weight: 700;
}

/* Entries Table */
.entries-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.entries-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.entries-table td {
    padding: 15px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
}

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

.entries-table tbody tr {
    transition: background-color 0.2s;
}

.entries-table tbody tr:hover {
    background-color: #f7f9fb;
}

.entry-row.editing {
    background-color: #fff3cd !important;
}

.entry-row input,
.entry-row textarea {
    padding: 8px 10px;
    border: 1px solid #667eea;
    border-left: 3px solid #667eea;
    border-radius: 5px;
    font-size: 13px;
    width: 100%;
    font-family: 'Poppins', sans-serif;
}

.entry-row textarea {
    min-height: 60px;
    resize: vertical;
}

.entry-row input:focus,
.entry-row textarea:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.entry-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.no-entries {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: #333;
    color: white;
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    max-width: 400px;
    font-size: 14px;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #28a745;
    border-left: 5px solid #1e7e34;
}

.toast.error {
    background: #dc3545;
    border-left: 5px solid #bd2130;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 15px;
    font-size: 20px;
    color: #5c5c5e;
    font-weight: 700;
}

.modal-content p {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 5px solid #ff1717;
    font-size: 13px;
}

.alert-danger-border {
    border-left: 5px solid #ff1717;
}

.alert-success-border {
    border-left: 5px solid #28a745;
}

.error {
    color: #ff1717;
}

.mandatory-icon {
    color: #ff1717;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 0;
    }

    .main-header {
        padding: 20px;
        text-align: center;
    }

    .main-header h1 {
        font-size: 20px;
        width: 100%;
        margin-bottom: 15px;
    }

    .user-info {
        width: 100%;
        justify-content: center;
    }

    .statistics-panel,
    .day-control-section,
    .entries-section {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-value {
        font-size: 28px;
    }

    .day-control-box {
        padding: 30px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .entries-table {
        font-size: 13px;
    }

    .entries-table th,
    .entries-table td {
        padding: 10px 8px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }

    .btn-large {
        padding: 14px 30px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    /* Mobile-friendly table */
    .entries-section {
        padding: 15px;
    }

    .entries-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .entries-table thead {
        display: none;
    }

    .entries-table tbody {
        display: block;
    }

    .entries-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .entries-table td {
        display: block;
        text-align: right;
        padding: 10px 15px;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
    }

    .entries-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: #667eea;
        font-size: 12px;
        text-transform: uppercase;
    }

    .entries-table td:last-child {
        border-bottom: none;
    }

    .entry-actions {
        flex-direction: row;
        justify-content: flex-end;
        gap: 8px;
    }

    .entry-actions .btn {
        width: auto;
        flex: 1;
        font-size: 12px;
        padding: 8px 12px;
    }

    .settings-panel {
        padding: 15px;
    }

    .settings-toggle-btn {
        font-size: 14px;
        padding: 12px 15px;
    }
}

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

.stat-card,
.day-control-box,
.entries-table {
    animation: fadeIn 0.5s ease-out;
}
