/**
 * Mini Time Tracker - Public Stylesheet
 * Blue / Dark Blue Aesthetic - Modern & Minimalist
 */

:root {
    --mtt-blue-primary: #1d4ed8;
    --mtt-blue-hover: #1e40af;
    --mtt-blue-dark: #0f172a;
    --mtt-blue-accent: #3b82f6;
    --mtt-blue-light: #eff6ff;
    --mtt-border-color: #e2e8f0;
    --mtt-text-main: #0f172a;
    --mtt-text-muted: #64748b;
    --mtt-success: #10b981;
    --mtt-warning: #f59e0b;
    --mtt-danger: #ef4444;
    --mtt-radius: 10px;
    --mtt-shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08);
    --mtt-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --mtt-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
}

.mtt-tracker-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--mtt-text-main);
    box-sizing: border-box;
    width: 100%;
    max-width: 1100px;
    margin: 24px auto;
    padding: 0;
}

.mtt-tracker-container *,
.mtt-tracker-container *::before,
.mtt-tracker-container *::after {
    box-sizing: inherit;
}

/* Header */
.mtt-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    padding: 20px 28px;
    border-radius: var(--mtt-radius);
    margin-bottom: 24px;
    box-shadow: var(--mtt-shadow-lg);
}

.mtt-tracker-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mtt-tracker-title-wrap .mtt-icon-svg {
    width: 28px;
    height: 28px;
    stroke: #60a5fa;
}

.mtt-tracker-title {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Common Buttons */
.mtt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease-in-out;
    text-decoration: none !important;
    line-height: 1.4;
}

.mtt-btn:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.mtt-btn-add {
    background: #ffffff;
    color: #1e3a8a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mtt-btn-add:hover {
    background: #f8fafc;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.mtt-btn-primary {
    background: var(--mtt-blue-primary);
    color: #ffffff;
}

.mtt-btn-primary:hover {
    background: var(--mtt-blue-hover);
}

.mtt-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.mtt-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.mtt-btn-danger {
    background: var(--mtt-danger);
    color: #ffffff;
}

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

.mtt-icon-svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

/* Alert / Toast */
.mtt-alert {
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: mttFadeIn 0.3s ease;
}

.mtt-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.mtt-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.mtt-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Timers Grid */
.mtt-timers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Empty State */
.mtt-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: var(--mtt-radius);
    color: var(--mtt-text-muted);
}

.mtt-empty-state svg {
    width: 48px;
    height: 48px;
    stroke: #94a3b8;
    margin-bottom: 12px;
}

.mtt-empty-state p {
    font-size: 16px;
    margin: 0;
    color: #64748b;
}

/* Loading Placeholder */
.mtt-loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mtt-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #cbd5e1;
    border-top-color: var(--mtt-blue-primary);
    border-radius: 50%;
    animation: mttSpin 0.8s linear infinite;
    display: inline-block;
}

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

/* Timer Card */
.mtt-card {
    background: #ffffff;
    border: 1px solid var(--mtt-border-color);
    border-radius: var(--mtt-radius);
    box-shadow: var(--mtt-shadow-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.mtt-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--mtt-shadow-lg);
}

.mtt-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.mtt-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--mtt-text-main);
    margin: 0;
    word-break: break-word;
    line-height: 1.3;
}

/* Status Badges */
.mtt-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.mtt-status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.mtt-badge-not_started {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}
.mtt-badge-not_started::before { background: #94a3b8; }

.mtt-badge-running {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.mtt-badge-running::before {
    background: #2563eb;
    animation: mttPulse 1.5s infinite;
}

.mtt-badge-paused {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.mtt-badge-paused::before { background: #f59e0b; }

.mtt-badge-completed {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.mtt-badge-completed::before { background: #10b981; }

@keyframes mttPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.4; }
}

/* Digits Display */
.mtt-card-display {
    text-align: center;
    background: #0f172a;
    border-radius: 8px;
    padding: 16px 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.mtt-time-digits {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 36px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.mtt-card.mtt-card-completed .mtt-time-digits {
    color: #34d399;
    text-shadow: 0 0 12px rgba(52, 211, 153, 0.3);
}

/* Controls */
.mtt-card-actions {
    display: flex;
    gap: 8px;
}

.mtt-btn-action {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.mtt-btn-start {
    background: #2563eb;
    color: #ffffff;
}
.mtt-btn-start:hover {
    background: #1d4ed8;
}

.mtt-btn-pause {
    background: #f59e0b;
    color: #ffffff;
}
.mtt-btn-pause:hover {
    background: #d97706;
}

.mtt-btn-resume {
    background: #2563eb;
    color: #ffffff;
}
.mtt-btn-resume:hover {
    background: #1d4ed8;
}

.mtt-btn-stop {
    background: #ffffff;
    color: #dc2626;
    border-color: #fca5a5;
}
.mtt-btn-stop:hover {
    background: #fee2e2;
}

.mtt-btn-disabled,
.mtt-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Modals */
.mtt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 16px;
}

.mtt-modal-card {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    animation: mttModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mtt-modal-sm {
    max-width: 400px;
}

@keyframes mttModalPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.mtt-modal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    color: #ffffff;
    padding: 18px 24px;
}

.mtt-modal-card-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
}

.mtt-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.mtt-modal-close:hover {
    color: #ffffff;
}

.mtt-modal-card-body {
    padding: 24px;
}

.mtt-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.mtt-required {
    color: var(--mtt-danger);
}

.mtt-field input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 15px;
    color: #0f172a;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mtt-field input[type="text"]:focus {
    border-color: var(--mtt-blue-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.mtt-field-error {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: var(--mtt-danger);
}

.mtt-confirm-text {
    font-size: 15px;
    color: #334155;
    margin: 0 0 16px 0;
}

.mtt-confirm-timer-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.mtt-stop-timer-name {
    font-weight: 600;
    color: #0f172a;
}

.mtt-stop-timer-duration {
    font-family: monospace;
    font-weight: 700;
    color: var(--mtt-blue-primary);
}

.mtt-modal-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Completed Card appearance */
.mtt-card-completed {
    border-color: #a7f3d0;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

/* Responsive */
@media (max-width: 640px) {
    .mtt-tracker-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px 20px;
    }
    .mtt-btn-add {
        width: 100%;
    }
    .mtt-time-digits {
        font-size: 28px;
    }
    .mtt-card-actions {
        flex-wrap: wrap;
    }
}

