/**
 * TimeTrack HR Dashboard Styles
 * Version: 2.0.0
 * Author: WMK Co
 */

/* Reset & Base */
.tt-hr-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: #f3f4f6;
    min-height: 100vh;
}

.tt-hr-app * {
    box-sizing: border-box;
}

/* Login Screen */
.tt-hr-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.tt-hr-login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.tt-hr-login-box h1 {
    margin: 0 0 10px;
    color: #1e3a5f;
    font-size: 28px;
}

.tt-hr-login-box h1 .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

.tt-hr-login-box p {
    color: #6b7280;
    margin-bottom: 30px;
}

/* Form Elements */
.tt-hr-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.tt-hr-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

.tt-hr-input,
.tt-hr-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tt-hr-input:focus,
.tt-hr-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.tt-hr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tt-hr-btn:hover {
    transform: translateY(-1px);
}

.tt-hr-btn-primary {
    background: #2563eb;
    color: white;
}

.tt-hr-btn-primary:hover {
    background: #1d4ed8;
}

.tt-hr-btn-secondary {
    background: #6b7280;
    color: white;
}

.tt-hr-btn-secondary:hover {
    background: #4b5563;
}

.tt-hr-btn-success {
    background: #10b981;
    color: white;
}

.tt-hr-btn-success:hover {
    background: #059669;
}

.tt-hr-btn-danger {
    background: #ef4444;
    color: white;
}

.tt-hr-btn-danger:hover {
    background: #dc2626;
}

.tt-hr-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.tt-hr-btn-block {
    width: 100%;
}

.tt-hr-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
}

/* Main Layout */
.tt-hr-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.tt-hr-header {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tt-hr-header h1 {
    margin: 0;
    font-size: 22px;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tt-hr-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#tt-hr-user-name {
    font-weight: 500;
    color: #374151;
}

/* Navigation */
.tt-hr-nav {
    background: #1e3a5f;
    padding: 0 20px;
    display: flex;
    gap: 5px;
    overflow-x: auto;
}

.tt-hr-nav-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 15px 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tt-hr-nav-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.tt-hr-nav-btn.active {
    color: white;
    border-bottom-color: #10b981;
}

.tt-hr-nav-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.tt-hr-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* Content Area */
.tt-hr-content {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tt-hr-view h2 {
    margin: 0 0 20px;
    color: #1f2937;
    font-size: 24px;
}

/* Stats Grid */
.tt-hr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tt-hr-stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #2563eb;
}

.tt-hr-stat-card.success { border-left-color: #10b981; }
.tt-hr-stat-card.warning { border-left-color: #f59e0b; }
.tt-hr-stat-card.danger { border-left-color: #ef4444; }

.tt-hr-stat-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.tt-hr-stat-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tt-hr-stat-clickable:hover .tt-hr-stat-label {
    color: #2563eb;
}

.tt-hr-stat-clickable:active {
    transform: translateY(-1px);
}

.tt-hr-stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 5px;
}

.tt-hr-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.tt-hr-stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.tt-hr-stats-row .tt-hr-stat-card {
    flex: 1;
}

/* Cards */
.tt-hr-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.tt-hr-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.tt-hr-card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

.tt-hr-card-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Tables */
.tt-hr-table {
    width: 100%;
    border-collapse: collapse;
}

.tt-hr-table th,
.tt-hr-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.tt-hr-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
}

.tt-hr-table tbody tr:hover {
    background: #f9fafb;
}

.tt-hr-table .tt-hr-empty {
    text-align: center;
    color: #9ca3af;
    padding: 40px;
}

/* Badges */
.tt-hr-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tt-hr-status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.tt-hr-status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.tt-hr-status-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.tt-hr-status-badge.info {
    background: #dbeafe;
    color: #1e40af;
}

.tt-hr-status-badge.gray {
    background: #f3f4f6;
    color: #4b5563;
}

/* Filters */
.tt-hr-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.tt-hr-filters .tt-hr-select,
.tt-hr-filters .tt-hr-input {
    width: auto;
    min-width: 150px;
}

/* Modal */
.tt-hr-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.tt-hr-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.tt-hr-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tt-hr-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.tt-hr-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
}

.tt-hr-modal-close:hover {
    color: #1f2937;
}

.tt-hr-modal-body {
    padding: 20px;
}

.tt-hr-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Alerts List */
.tt-hr-alert-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tt-hr-alert-item:last-child {
    border-bottom: none;
}

.tt-hr-alert-item.unread {
    background: #eff6ff;
}

.tt-hr-alert-content {
    flex: 1;
}

.tt-hr-alert-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.tt-hr-alert-message {
    color: #6b7280;
    font-size: 13px;
}

.tt-hr-alert-time {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 5px;
}

/* Loading Spinner */
.tt-hr-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.tt-hr-loading:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .tt-hr-header {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tt-hr-nav {
        padding: 0 10px;
    }
    
    .tt-hr-nav-btn {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .tt-hr-content {
        padding: 15px;
    }
    
    .tt-hr-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tt-hr-filters .tt-hr-select,
    .tt-hr-filters .tt-hr-input,
    .tt-hr-filters .tt-hr-btn {
        width: 100%;
    }
    
    .tt-hr-stats-row {
        flex-direction: column;
    }
    
    .tt-hr-table {
        display: block;
        overflow-x: auto;
    }
    
    .tt-hr-modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
}

/* Settings specific styles */
.tt-hr-form-row {
    display: flex;
    gap: 20px;
}
.tt-hr-form-row .tt-hr-form-group {
    flex: 1;
}
.tt-hr-help {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0;
}
.tt-hr-form-buttons {
    display: flex;
    gap: 10px;
}
#tt-hr-view-settings .tt-hr-card {
    margin-bottom: 20px;
}
#tt-hr-view-settings h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}
