/* app/static/css/styles.css */

/* Main Title */
.scorecard-main-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

/* Scorecard Table */
.scorecard-table {
    border-collapse: collapse;
    width: 100%;
}

.scorecard-table th,
.scorecard-table td {
    border: 1px solid #ccc;
    padding: 8px 12px;
    vertical-align: middle;
}

/* Header styling - Blue theme */
.scorecard-table thead th {
    background-color: #4472C4;
    color: white;
    text-align: center;
    font-weight: 600;
}

.scorecard-table .header-months th {
    background-color: #4472C4;
    font-size: 1rem;
}

.scorecard-table .header-weeks th {
    background-color: #5B8BD4;
    font-size: 0.85rem;
    padding: 4px 8px;
}

/* Column widths */
.scorecard-table .col-emoji {
    width: 40px;
    min-width: 40px;
    max-width: 50px;
    text-align: center;
    padding: 4px !important;
}

.scorecard-table .emoji-cell {
    cursor: pointer;
    background-color: #fff;
}

.scorecard-table .emoji-cell:hover {
    background-color: #f8f9fa;
}

.scorecard-table .activity-emoji {
    font-size: 24px;
    line-height: 1;
}

.scorecard-table .emoji-placeholder {
    color: #ccc;
    font-size: 16px;
    font-weight: 300;
}

.scorecard-table .emoji-placeholder:hover {
    color: #999;
}

.scorecard-table .col-activity {
    min-width: 160px;
    width: 180px;
    text-align: center;
}

/* Comparison operator column */
.scorecard-table .col-op {
    width: 30px;
    min-width: 30px;
    max-width: 35px;
    background-color: #D6DCE5;
    color: #333;
    font-weight: bold;
    padding: 4px !important;
    cursor: pointer;
}

.scorecard-table .col-op:hover {
    background-color: #c5cdd8;
}

/* Success column */
.scorecard-table .col-success {
    width: 55px;
    min-width: 50px;
    max-width: 60px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Success percentage gradient colors */
.bg-success-red {
    background-color: #F4B4B4 !important;
}

.bg-success-orange {
    background-color: #FFCC99 !important;
}

.bg-success-yellow {
    background-color: #FFEB99 !important;
}

.bg-success-lightgreen {
    background-color: #C8E6C8 !important;
}

.bg-success-green {
    background-color: #90D490 !important;
}

.scorecard-table .col-goal {
    width: 45px;
    min-width: 45px;
    max-width: 50px;
    text-align: center;
}

.scorecard-table .col-actions {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    background-color: #fff;
    padding: 2px !important;
}

.scorecard-table thead .col-actions {
    background-color: #4472C4;
    border-color: #4472C4;
}

.scorecard-table .month-header {
    border-left: 2px solid #fff;
}

.scorecard-table .week-header {
    min-width: 40px;
    width: 45px;
    line-height: 1.1;
    font-size: 0.8rem;
    padding: 3px 2px !important;
}

/* Data rows */
.scorecard-table .activity-row td {
    background-color: #fff;
    padding: 6px 8px;
}

.scorecard-table .activity-name {
    font-weight: 600;
    text-align: left;
    padding-left: 12px !important;
    white-space: nowrap;
}

.scorecard-table .goal-cell {
    background-color: #D6DCE5;
    font-weight: 600;
    padding: 6px 4px !important;
}

.scorecard-table tbody .col-op {
    padding: 6px 4px !important;
}

/* Color Coding for values */
.bg-light-red {
    background-color: #F4B4B4 !important;
}

.bg-bright-green {
    background-color: #B4E4B4 !important;
}

.bg-dark-green {
    background-color: #90D490 !important;
}

.bg-partial-orange {
    background-color: #FFEB99 !important;
}

/* Value cells */
.scorecard-table .value-cell {
    min-width: 40px;
    width: 45px;
    padding: 6px 4px !important;
}

/* Cursor for Editable Cells */
td[contenteditable="true"] {
    cursor: pointer;
}

/* Highlight cell on focus */
td[contenteditable="true"]:focus {
    outline: 2px solid #80bdff;
    background-color: #e2e6ea !important;
}

/* Add activity row */
#add-activity-row td {
    background-color: #f8f9fa;
    padding: 6px 8px;
}

#add-activity-row .col-op {
    background-color: #D6DCE5;
}

#add-activity-row input {
    padding: 2px 6px;
    height: auto;
}

#add-activity-row #activity-goal {
    width: 50px !important;
}

/* Responsive Table: Enable horizontal scrolling on small screens */
.table-responsive {
    overflow-x: auto;
}

/* Sliding Alerts */
.alert-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
    width: 100%;
}

.alert-slide {
    animation: slideIn 0.3s ease-out forwards;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alert-slide.sliding-out {
    animation: slideOut 0.3s ease-in forwards;
}

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

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

/* Mobile-optimized alerts - compact, bottom-positioned, semi-transparent */
@media (max-width: 768px) {
    .alert-container {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .alert-slide {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        margin-bottom: 6px;
        background-color: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .alert-slide.alert-success {
        background-color: rgba(212, 237, 218, 0.95) !important;
    }

    .alert-slide.alert-danger {
        background-color: rgba(248, 215, 218, 0.95) !important;
    }

    .alert-slide.alert-warning {
        background-color: rgba(255, 243, 205, 0.95) !important;
    }

    .alert-slide.alert-info {
        background-color: rgba(209, 236, 241, 0.95) !important;
    }

    .alert-slide .btn-close {
        padding: 0.25rem;
        font-size: 0.7rem;
    }

    .alert-slide i {
        font-size: 0.85rem;
    }

    /* Slide from bottom on mobile */
    @keyframes slideIn {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

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

/* Comparison Operator Popup */
.op-popup {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 50px;
}

.op-option {
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.op-option:last-child {
    border-bottom: none;
}

.op-option:hover {
    background-color: #f0f0f0;
}

.op-option.selected {
    background-color: #4472C4;
    color: white;
}

.op-option.selected:hover {
    background-color: #3a62a8;
}

/* Share Panel */
.share-panel {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.share-header {
    background-color: #f8f9fa;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    color: #4472C4;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.share-header:hover {
    background-color: #e9ecef;
}

.share-header .toggle-icon {
    margin-left: auto;
}

.share-content {
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

/* Rounded Table Style - applies to all cells */
.scorecard-table.rounded-table {
    border-collapse: separate;
    border-spacing: 2px;
}

.scorecard-table.rounded-table th,
.scorecard-table.rounded-table td {
    border-radius: 6px;
}

/* Bold button active state */
.btn-outline-secondary.active {
    background-color: #6c757d;
    color: white;
}

/* Print Styles */
@media print {
    .share-panel,
    .alert-container,
    #edit-title-btn,
    .delete-activity,
    #add-activity-row,
    .emoji-placeholder,
    nav {
        display: none !important;
    }

    .scorecard-table {
        width: 100%;
    }

    .table-responsive {
        overflow: visible;
    }

    body {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Drag and Drop Reordering (Premium Feature) */
.col-drag {
    width: 30px;
    min-width: 30px;
}

.drag-handle {
    cursor: grab;
    color: #aaa;
    width: 30px;
    min-width: 30px;
}

.drag-handle:hover {
    color: #666;
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #e3f2fd;
}

.sortable-chosen {
    background-color: #f5f5f5;
}

/* Month Navigation (Auto-Focus Feature) */
#month-navigation {
    padding: 8px 0;
}

.nav-arrow-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.nav-arrow-btn:hover {
    background-color: #4472C4;
    border-color: #4472C4;
    color: white;
}

.nav-arrow-btn:disabled,
.nav-arrow-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

#month-range-display {
    min-width: 250px;
    text-align: center;
    font-weight: 500;
}

#reset-viewpoint-btn {
    border-radius: 20px;
    padding: 4px 12px;
}

/* Hide navigation in print */
@media print {
    #month-navigation {
        display: none !important;
    }
}