/* Civil Case File Management System - Styles */
/* Mobile-friendly, responsive, clean design */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.login-box h1 {
    color: #1a73e8;
    font-size: 28px;
    margin-bottom: 5px;
}

.login-box h2 {
    color: #666;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 30px;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #1a73e8;
}

.input-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

/* Buttons */
.btn-login,
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-login:hover,
.btn-primary:hover {
    background: #1557b0;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: #e0e0e0;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-search {
    padding: 12px 24px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-search:hover {
    background: #1557b0;
}

/* Messages */
.error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    color: #1a73e8;
    font-size: 22px;
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

nav a {
    padding: 10px 16px;
    text-decoration: none;
    color: #555;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 14px;
}

nav a:hover,
nav a.active {
    background: #1a73e8;
    color: white;
}

/* Main Content */
main {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

main h2 {
    margin-bottom: 25px;
    color: #333;
}

/* Search Section */
.search-section {
    margin-bottom: 25px;
}

.global-search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.global-search-form input {
    flex: 1;
    min-width: 250px;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.global-search-form input:focus {
    outline: none;
    border-color: #1a73e8;
}

.search-results-info {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* DateTime Card */
.datetime-card {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 30px;
}

.datetime-card .time {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.datetime-card .date {
    font-size: 20px;
    margin-bottom: 5px;
}

.datetime-card .day {
    font-size: 18px;
    opacity: 0.9;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1a73e8;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.dashboard-card:hover {
    border-color: #1a73e8;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(26,115,232,0.2);
}

.dashboard-card .icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.dashboard-card h3 {
    margin-bottom: 10px;
    color: #1a73e8;
    font-size: 16px;
}

.dashboard-card p {
    color: #666;
    font-size: 13px;
}

/* Cases Grid */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.case-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.case-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.case-header h4 {
    color: #1a73e8;
    font-size: 18px;
    flex: 1;
    margin-right: 10px;
}

.file-count {
    background: #1a73e8;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.case-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.case-footer {
    border-top: 1px solid #e0e0e0;
    padding-top: 12px;
}

.last-update {
    font-size: 12px;
    color: #888;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    color: #888;
    margin-bottom: 20px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h2 {
    margin: 0;
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.filter-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-form select,
.filter-form input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.filter-form select:focus,
.filter-form input:focus {
    outline: none;
    border-color: #1a73e8;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.file-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.file-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #1a73e8;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.category-badge.notice { background: #e91e63; }
.category-badge.order { background: #9c27b0; }
.category-badge.judgment { background: #673ab7; }
.category-badge.memo { background: #2196f3; }
.category-badge.other { background: #607d8b; }

.file-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.file-icon {
    font-size: 32px;
}

.file-header h4 {
    flex: 1;
    color: #333;
    font-size: 16px;
    word-break: break-all;
}

.file-details {
    margin-bottom: 15px;
}

.file-details p {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.file-notes {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.file-notes strong {
    color: #1a73e8;
}

.file-notes p {
    color: #555;
    margin-top: 5px;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.btn-view,
.btn-download,
.btn-delete {
    flex: 1;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-view {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-view:hover {
    background: #c8e6c9;
}

.btn-download {
    background: #1a73e8;
    color: white;
}

.btn-download:hover {
    background: #1557b0;
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-delete:hover {
    background: #ffcdd2;
}

/* Upload Form */
.upload-form {
    max-width: 700px;
}

.upload-form .btn-primary {
    width: auto;
    margin-right: 10px;
}

.file-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-info p {
    margin-bottom: 5px;
    font-size: 14px;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #e0e0e0;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: #1a73e8;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.timeline-date {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.timeline-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #1a73e8;
}

.timeline-content.notice { border-left-color: #e91e63; }
.timeline-content.order { border-left-color: #9c27b0; }
.timeline-content.judgment { border-left-color: #673ab7; }
.timeline-content.memo { border-left-color: #2196f3; }
.timeline-content.note { border-left-color: #4caf50; }
.timeline-content.other { border-left-color: #607d8b; }

.timeline-content h4 {
    color: #333;
    margin-bottom: 10px;
}

.timeline-content p {
    color: #666;
    font-size: 14px;
}

/* Notes and Memos */
.note-card,
.memo-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #1a73e8;
}

.note-card {
    border-left-color: #4caf50;
}

.memo-card {
    border-left-color: #2196f3;
}

.note-card h4,
.memo-card h4 {
    color: #333;
    margin-bottom: 10px;
}

.note-card p,
.memo-card p {
    color: #666;
    font-size: 14px;
}

.note-meta,
.memo-meta {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a73e8;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        justify-content: center;
    }
    
    .datetime-card .time {
        font-size: 36px;
    }
    
    .datetime-card .date {
        font-size: 16px;
    }
    
    .page-header {
        flex-direction: column;
        text-align: center;
    }
    
    .cases-grid,
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .global-search-form {
        flex-direction: column;
    }
    
    .global-search-form input {
        width: 100%;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.3s ease;
}

/* Additional Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* Timeline Thumbnail */
.timeline-thumbnail {
    display: inline-block;
    margin: 10px 0;
}

.timeline-thumbnail:hover {
    opacity: 0.8;
}

.timeline-thumbnail img {
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s;
}

.timeline-thumbnail:hover img {
    border-color: #1a73e8;
}

/* Selected Files List */
.selected-files-list {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 2px solid #e0e0e0;
}

/* Timeline Search Box */
#timelineSearch {
    transition: border-color 0.3s, box-shadow 0.3s;
}

#timelineSearch:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

#timelineSearch::placeholder {
    color: #999;
}

/* Timeline Search Highlight */
.timeline-item.highlight {
    animation: highlightPulse 0.6s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

/* Universal Back Icon */
.btn-back-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
    cursor: pointer;
    user-select: none;
}

.btn-back-icon:hover {
    background: linear-gradient(135deg, #1557b0 0%, #08306b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.btn-back-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3);
}

/* Position back icon in header */
header .btn-back-icon {
    margin-right: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-back-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}


.selected-files-list ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.selected-files-list li {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.selected-files-list li:last-child {
    border-bottom: none;
    padding-top: 10px;
}

/* Compact Timeline Table */
.compact-timeline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}

.compact-timeline-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
}

.compact-timeline-table th:hover {
    background: #e8e8e8;
}

.compact-timeline-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.compact-timeline-table tr:hover {
    background: #f8f9fa;
}

.sort-indicator {
    margin-left: 5px;
    font-size: 10px;
}

/* Timeline Search Box */
#tableSearch {
    transition: border-color 0.3s, box-shadow 0.3s;
}

#tableSearch:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

#tableSearch::placeholder {
    color: #999;
}

/* Timeline Row Highlight */
.timeline-row.highlight {
    animation: highlightPulse 0.4s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% {
        background: white;
    }
    50% {
        background: #e3f2fd;
    }
}
