/* ===================================================================
 * styles-animations.css
 * Purpose: Loading spinners, transitions, fade-in/animation keyframes
 * Extracted from styles.css during the Apr 2026 split (task #23).
 * =================================================================== */
/* Loading animations and transitions */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1080;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

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

    100% {
        transform: rotate(360deg);
    }
}

/* Table animations */
.table tr {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.table tr.fade-out {
    opacity: 0;
    transform: translateX(-20px);
}

.table tr.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Input animations */
.form-control,
.form-select {
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Button animations */
.btn {
    transition: all 0.2s ease;
}

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

.btn:active {
    transform: translateY(1px);
}

/* Loading state for buttons */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Smooth transitions for notifications */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1070;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.alert.show {
    opacity: 1;
    transform: translateX(0);
}

/* Editable field animations */
.editable {
    position: relative;
    transition: background-color 0.2s ease;
}

.editable:hover {
    background-color: rgba(245, 179, 1, 0.1);
}

.editable:hover::after {
    content: '✎';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.toast-container {
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 20000 !important;
    pointer-events: none;
}

.toast {
    padding: 15px 25px;
    border-radius: 4px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 350px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .toast {
    background-color: #fff;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .toast {
    background-color: #333;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-header {
    background-color: var(--dark-bg);
    border-bottom-color: var(--border-color);
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

[data-theme="light"] .toast.show {
    opacity: 1;
    transform: translateX(0);
}

[data-theme="dark"] .toast.show {
    opacity: 1;
    transform: translateX(0);
}

.timer-button {
    margin: 10px 0;
    padding: 10px 20px;
    fontsize: 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
}

.admin-actions {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.admin-actions button {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

table th input[type="checkbox"],
table td input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
}

.table {
    font-size: 0.9rem;
}

.phase-row {
    background-color: var(--dark-bg);
    font-weight: bold;
    border-top: 2px solid var(--primary-color);
    font-size: 1.3rem;
    color: #FFFFFF !important;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    font-weight: 600;
}

.cc-row {
    background-color: var(--dark-bg);
    font-weight: bold;
    border-top: 2px dotted var(--primary-color);
    font-size: 1.1rem;
    color: #FFFFFF !important;
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

tr[data-level="item"] {
    font-size: 0.9rem;
}

.phase-row td,
.cc-row td {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #000000;
}

.add-item-btn {
}

.floating-window .window-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.floating-window .window-controls button {
    padding: 2px 6px;
    font-size: 12px;
}

.floating-window-content {
    height: calc(100% - 40px);
    overflow: auto;
    padding: 10px;
}

.floating-window .table-container {
    width: 100%;
    height: 100%;
}

.floating-window .table {
    font-family: 'Times New Roman', serif;
    font-style: italic;
}

.project-total-row {
    background-color: var(--dark-bg);
    border-top: 2px solid var(--primary-color);
    font-size: 1.5em;
    color: #ffffff !important;
    font-weight: bold;
    white-space: nowrap;
}

.project-total-row td {
    padding: 20px 8px !important;
    color: #ffffff !important;
}

.project-total-row td * {
    color: #ffffff !important;
}

.project-total-row td:last-child {
    text-align: right;
    min-width: 250px;
    max-width: none;
    white-space: nowrap;
    padding-right: 15px !important;
    overflow: visible;
    font-size: 0.85em;
    letter-spacing: -0.3px;
}

.project-total {
    min-width: 250px;
    max-width: none;
    white-space: nowrap;
    text-align: right;
    overflow: visible;
    font-size: 0.85em;
    letter-spacing: -0.3px;
}

.date-range-icons {
    display: flex;
    align-items: center;
}

.date-input {
    width: 16px;
    padding: 0;
    border: none;
    color: transparent;
    background: var(--color-accent-600) !important;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
}

.date-input:hover {
    background: #ff8c00 !important;
}

.date-input::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: #333;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.date-input:hover::before {
    opacity: 1;
    visibility: visible;
}

.clear-dates {
    cursor: pointer;
    color: #666;
}

.clear-dates:hover {
    color: #dc3545;
}

