/**
 * Time Tracking Styles
 */

/* Header */
.app-header {
    background: #1a202c;
    border: 1px solid #4a5568;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

.btn-back,
.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    transition: all 0.2s ease;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
}

.btn-back:hover,
.btn-icon:hover {
    background: rgba(251, 191, 36, 0.1);
}

.btn-back:active,
.btn-icon:active {
    transform: scale(0.95);
}

/* Timer Display */
.timer-display {
    font-size: 4rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #fbbf24;
    text-align: center;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .timer-display {
        font-size: 3rem;
    }
}

/* Timer Card */
#timer-card {
    background: linear-gradient(135deg, #f8f9fa 0%,#ffffff 100%);
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    color: #ffffff;
}

#timer-card .card-body {
    padding: 32px 24px;
}

/* Pulse Animation for Recording Icon */
.pulse-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Timer State Sections */
#timer-idle,
#timer-running,
#timer-paused {
    transition: all 0.3s ease;
}

/* Timer Buttons */
#timer-card .btn {
    min-height: 56px;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 12px;
    transition: all 0.2s;
}

#timer-card .btn:active {
    transform: scale(0.97);
}

#timer-card .btn-lg {
    min-height: 64px;
    font-size: 1.25rem;
}

/* Quick Time Buttons */
.quick-time-btn {
    min-height: 64px;
    font-weight: 600;
    border-radius: 12px;
    border-width: 2px;
    transition: all 0.2s;
}

.quick-time-btn:hover,
.quick-time-btn:active {
    background: #fbbf24;
    color: white;
    border-color: #fbbf24;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

/* Time Entry Items */
.time-entry-item {
    background: #1a202c;
    transition: all 0.2s;
    border-radius: 12px !important;
    color: #ffffff;
}

.time-entry-item:hover {
    background: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.time-entry-item .btn-outline-danger {
    min-height: 40px;
    min-width: 40px;
}

/* Manual Entry Form */
#manual-entry-form .form-control,
#manual-entry-form .form-select {
    min-height: 52px;
    border-radius: 8px;
    border: 2px solid #4a5568;
    font-size: 1rem;
}

#manual-entry-form .form-control:focus,
#manual-entry-form .form-select:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 0.2rem rgba(251, 191, 36, 0.25);
}

#manual-entry-form .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #a0aec0;
    margin-bottom: 8px;
}

#manual-entry-form textarea {
    resize: none;
}

/* Total Time Summary */
.total-time-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #374151 100%);
    padding: 20px;
    border-radius: 12px;
}

.total-time-summary .fs-4 {
    font-size: 2rem !important;
}

/* Section Headers */
.card-header h5 {
    display: flex;
    align-items: center;
    margin: 0;
}

.card-header h5 i {
    font-size: 1.25rem;
}

/* Status Colors */
.text-success {
    color: #198754 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Badge Styling */
.badge {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
}

/* Touch Optimization */
@media (pointer: coarse) {
    .btn {
        min-height: 56px;
    }
    
    .btn-sm {
        min-height: 48px;
    }
    
    .quick-time-btn {
        min-height: 72px;
        font-size: 1.1rem;
    }
    
    .form-control,
    .form-select {
        min-height: 56px;
        font-size: 1.1rem;
    }
}

/* Tablet Optimization */
@media (min-width: 768px) {
    .timer-display {
        font-size: 5rem;
    }
    
    #timer-card .card-body {
        padding: 48px 32px;
    }
    
    .quick-time-btn {
        min-height: 72px;
        font-size: 1.15rem;
    }
}

/* Landscape Optimization */
@media (min-width: 768px) and (orientation: landscape) {
    .timer-display {
        font-size: 4.5rem;
    }
}

/* Collapsing Animation */
.collapse {
    transition: height 0.3s ease;
}

.collapsing {
    transition: height 0.3s ease;
}

/* Form Buttons */
form .btn {
    border-radius: 8px;
    font-weight: 600;
}

/* Row Gutters */
.row.g-2 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

/* Content Wrapper */
.content-wrapper {
    padding-bottom: 100px;
}

/* Card Spacing */
.card {
    margin-bottom: 20px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #ffffff;
        color: #374151;
    }

    #timer-card {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
        color: #374151;
    }
    
    .timer-display {
        color: #4dabf7;
    }
    
    .time-entry-item {
        background: #2d2d2d;
        color: #374151;
        border-color: #495057 !important;
    }

    .time-entry-item p,
    .time-entry-item small,
    .text-muted {
        color: #adb5bd !important;
    }
    
    .time-entry-item:hover {
        background: #1a1a1a;
        color: #374151;
    }
    
    .total-time-summary {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
        color: #374151;
    }
    
    #manual-entry-form .form-control,
    #manual-entry-form .form-select {
        background: #2d2d2d;
        color: #374151;
        border-color: #a0aec0;
    }
    
    #manual-entry-form .form-control:focus,
    #manual-entry-form .form-select:focus {
        background: #1a1a1a;
        border-color: #4dabf7;
    }
    
    #manual-entry-form .form-label {
        color: #adb5bd;
    }

    .card {
        background: #2d2d2d;
        color: #374151;
    }

    .card-header {
        background: #1a1a1a;
        color: #374151;
    }
}

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

#timer-running,
#timer-paused,
#timer-idle {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Typography */
@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 1rem;
    }
}

/* Text Truncation */
.time-entry-item p {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Icon Sizing */
.bi {
    vertical-align: middle;
}

.card-header .bi {
    font-size: 1.25rem;
}

.time-entry-item .bi {
    font-size: 1.1rem;
}

/* Border Radius Consistency */
.btn {
    border-radius: 8px;
}

.card {
    border-radius: 12px;
}

.badge {
    border-radius: 8px;
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(251, 191, 36, 0.25);
}

/* Loading State (if needed) */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success State Animation */
@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }
}

.btn-success:active {
    animation: successPulse 0.6s ease-out;
}
