/* Jira Time Tracker Styles */
:root {
    --primary-color: #0052CC;
    --secondary-color: #42526E;
    --success-color: #00875A;
    --warning-color: #FF991F;
    --error-color: #DE350B;
    --bg-color: #F4F5F7;
    --card-bg: #FFFFFF;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --border-color: #DFE1E6;
    --shadow: 0 1px 3px rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
}

h2 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

h3 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-color);
    border-radius: 20px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.status-indicator.connected {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.disconnected {
    background: var(--error-color);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 135, 90, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 135, 90, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 135, 90, 0);
    }
}

/* Authentication Section */
.auth-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}

.info-box {
    background: #DEEBFF;
    border: 1px solid #B3D4FF;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-box p {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.info-box ol {
    margin-left: 20px;
    color: var(--text-secondary);
}

.info-box a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

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

label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0747A6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,82,204,0.3);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220,53,69,0.3);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary-color);
}

/* Filters */
.filters {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-group input[type="date"],
.filter-group select {
    width: auto;
    min-width: 150px;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Color coding for summary cards */
.summary-card.card-low {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border: 2px solid #dc3545;
}

.summary-card.card-medium {
    background: linear-gradient(135deg, #fff8f0 0%, #ffe5cc 100%);
    border: 2px solid #ff9800;
}

.summary-card.card-good {
    background: linear-gradient(135deg, #f0fff5 0%, #d4f4e4 100%);
    border: 2px solid #28a745;
}

.summary-card.card-high {
    background: linear-gradient(135deg, #faf0ff 0%, #e8d5f2 100%);
    border: 2px solid #9c27b0;
}

.summary-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 10px;
}

/* Data Section */
.data-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

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

/* Loading */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-color);
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--bg-color);
}

tbody tr:last-child td {
    border-bottom: none;
}

table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

table a:hover {
    text-decoration: underline;
}

.project-badge {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-color);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

small {
    color: var(--text-secondary);
    font-style: italic;
}

/* Days Overview Grid */
.days-overview {
    margin-bottom: 30px;
}

.days-overview h3 {
    margin-bottom: 15px;
    color: #333;
}

.weeks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.weeks-navigation {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    padding: 8px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn.nav-today {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-btn.nav-today:hover {
    background: #0747A6;
}

.weeks-range {
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 10px;
}

.weeks-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.week-group {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    background: #fff;
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.week-title {
    font-weight: 600;
    color: #333;
}

.week-stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

.week-total {
    font-size: 18px;
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 20px;
}

.week-average {
    font-size: 14px;
    color: #666;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.day-tile {
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
}

.day-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.day-tile .date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.day-tile .hours {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Color coding based on 8h workday */
.day-tile.hours-none {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #dee2e6;
}

.day-tile.hours-low {
    /* 0-4 hours: Red */
    background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
    border-color: #dc3545;
}

.day-tile.hours-medium {
    /* 5 hours: Orange */
    background: linear-gradient(135deg, #ffe5b4 0%, #ffcc80 100%);
    border-color: #ff9800;
}

.day-tile.hours-good {
    /* 6-8 hours: Green */
    background: linear-gradient(135deg, #d1f2eb 0%, #a8e6cf 100%);
    border-color: #28a745;
}

.day-tile.hours-high {
    /* 9+ hours: Purple */
    background: linear-gradient(135deg, #e8d5f2 0%, #d4a5f5 100%);
    border-color: #9c27b0;
}

.day-tile.weekend {
    opacity: 0.6;
    background: linear-gradient(135deg, #f0f0f0 0%, #d9d9d9 100%);
}

/* Days with custom target hours */
.day-tile.has-target {
    position: relative;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 1px rgba(0, 82, 204, 0.2);
}

.day-tile.has-target::before {
    content: "⚙";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 14px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    opacity: 0.5;
}

.day-tile.day-off {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #2196f3;
}

.day-tile.day-off.hours-none {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #9ca3af;
}

.day-tile.day-off .target-info {
    color: #2196f3;
    font-weight: bold;
}

.day-tile .target-info {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 9px;
    color: var(--primary-color);
    font-weight: bold;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.9);
    padding: 1px 3px;
    border-radius: 3px;
}

.day-tile .target-info.auto {
    opacity: 0.6;
    font-style: italic;
}

.day-tile.auto-off {
    border: 1px dashed #9ca3af;
}

/* Week color coding */
.week-group.week-low {
    border-color: #dc3545;
    background: linear-gradient(to bottom, #fff5f5 0%, #fff 100%);
}

.week-group.week-medium {
    border-color: #ff9800;
    background: linear-gradient(to bottom, #fff8f0 0%, #fff 100%);
}

.week-group.week-good {
    border-color: #28a745;
    background: linear-gradient(to bottom, #f0fff5 0%, #fff 100%);
}

.week-group.week-high {
    border-color: #9c27b0;
    background: linear-gradient(to bottom, #faf0ff 0%, #fff 100%);
}

.week-total.week-low {
    background: #dc3545;
    color: white;
}

.week-total.week-medium {
    background: #ff9800;
    color: white;
}

.week-total.week-good {
    background: #28a745;
    color: white;
}

.week-total.week-high {
    background: #9c27b0;
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #C32008;
}

/* Error Message */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--error-color);
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.error-icon {
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .table-container {
        overflow-x: scroll;
    }
    
    table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .data-section {
        padding: 15px;
    }
}