/* XP Planner Styles */

/* Goals and Events Row - Fixed Width Layout */
.goals-events-row {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .goals-events-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .goal-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .goal-percentage {
        align-self: center;
        font-size: 1.2rem;
        order: 2;
        margin-top: 8px;
    }
    
    .goal-input-group {
        order: 1;
    }
}

/* Goal Setting Section */
.planner-goal-section {
    padding: 20px 24px;
}

.goal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
}

.goal-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.goal-percentage {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--nintendo-red);
    background: rgba(230, 0, 18, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    border: 2px solid rgba(230, 0, 18, 0.2);
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

/* Main Planner Layout */
.planner-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    margin-top: 24px;
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

/* Button sizing for card actions */
.card-actions .nintendo-button {
    width: auto;
    min-width: 100px;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.card-actions .nintendo-button.small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.add-activity-btn {
    background: var(--nintendo-primary-gradient);
    border: none;
    border-radius: var(--nintendo-border-radius-small);
    padding: 8px 16px;
    color: white;
    font-family: var(--nintendo-font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: var(--nintendo-shadow-light);
    min-width: 120px;
}

.add-activity-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--nintendo-shadow-medium);
}

.goal-input-group label {
    font-weight: 600;
    color: var(--nintendo-dark);
    font-size: 0.95rem;
    min-width: 80px;
}

.goal-input-group input {
    padding: 10px 16px;
    border: 2px solid rgba(230, 0, 18, 0.2);
    border-radius: 8px;
    background: var(--nintendo-white);
    color: var(--nintendo-dark);
    font-size: 0.95rem;
    font-weight: 600;
    width: 120px;
    transition: border-color 0.3s ease;
}

.goal-input-group input:focus {
    outline: none;
    border-color: var(--nintendo-red);
}

.goal-label {
    color: var(--nintendo-gray);
    font-size: 0.9rem;
}

.goal-progress {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(230, 0, 18, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--nintendo-red), #ff6b6b);
    border-radius: 6px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    color: var(--nintendo-gray);
    font-weight: 1000;
}

.progress-text #currentProgress {
    
    font-weight: 700;
    font-size: 1rem;
    margin: 0 2px;
}

.progress-text #goalTarget {
    color: var(--nintendo-red);
    margin: 0 2px;
    font-size: 1rem;
}

.progress-text span:not(#currentProgress):not(#goalTarget) {
    font-weight: 700;
    color: var(--nintendo-dark-gray);
}

/* Current Events Section */
.current-events-section {
    padding: 0px 24px 20px;
}

.active-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(230, 0, 18, 0.05);
    border-radius: var(--nintendo-border-radius-small);
    border-left: 4px solid var(--nintendo-red);
    transition: all 0.3s ease;
}

.event-item:hover {
    background: rgba(230, 0, 18, 0.1);
    transform: translateX(2px);
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-name {
    font-weight: 600;
    color: var(--nintendo-dark);
    font-size: 0.9rem;
}

.event-description {
    font-size: 0.8rem;
    color: var(--nintendo-gray);
}

.event-badge {
    background: var(--nintendo-primary-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Events Tags Container */
.events-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.event-tag {
    background: var(--nintendo-primary-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: default;
}

.event-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
}

/* Event Indicators for Activities */
.event-indicator {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
}

.event-indicator.multiplier {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.event-indicator.bonus {
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: white;
}

/* XP Display with Events */
.base-xp {
    color: var(--nintendo-gray);
    text-decoration: line-through;
    font-size: 0.9rem;
}

.event-xp {
    color: var(--nintendo-red);
    font-weight: 700;
}

/* Modal Preview Breakdown */
.preview-breakdown {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(230, 0, 18, 0.1);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.base-breakdown {
    color: var(--nintendo-gray);
}

.event-breakdown {
    color: var(--nintendo-red);
    font-weight: 600;
}

/* Daily Limit Information */
.limit-info {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(0, 123, 255, 0.1);
    border-left: 3px solid var(--nintendo-blue);
    border-radius: 4px;
}

.limit-text {
    color: var(--nintendo-blue);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Limit Warning */
.limit-warning {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    border-radius: 4px;
}

.warning-text {
    color: #f57c00;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Limit Notification */
.limit-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 193, 7, 0.95);
    border-left: 4px solid #f57c00;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-icon {
    font-size: 1.1rem;
}

.notification-text {
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

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

.no-events {
    text-align: center;
    color: var(--nintendo-gray);
    font-style: italic;
    padding: 20px;
}

/* Templates Modal */
.modal-overlay {
    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;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(230, 0, 18, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--nintendo-white);
}

.modal-header h3 {
    margin: 0;
    color: var(--nintendo-dark);
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--nintendo-gray);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(230, 0, 18, 0.1);
    color: var(--nintendo-red);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(230, 0, 18, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--nintendo-white);
}

.templates-grid-modal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.template-card {
    border: 2px solid rgba(230, 0, 18, 0.15);
    border-radius: 16px;
    padding: 24px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.template-card:hover {
    border-color: var(--nintendo-red);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(230, 0, 18, 0.15);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(230, 0, 18, 0.1);
}

.template-header h4 {
    margin: 0;
    color: var(--nintendo-dark);
    font-size: 1.3rem;
    font-weight: 700;
}

.template-xp {
    background: linear-gradient(135deg, var(--nintendo-red), #ff4757);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

.template-activities {
    margin-bottom: 20px;
}

.template-activity {
    color: var(--nintendo-gray);
    font-size: 0.95rem;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(230, 0, 18, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--nintendo-red);
}

.template-select-btn {
    width: 100%;
    background: var(--nintendo-primary-gradient);
    color: white;
    border: none;
    border-radius: var(--nintendo-border-radius-small);
    padding: 14px 20px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--nintendo-shadow-light);
    font-family: var(--nintendo-font-family);
}

.template-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--nintendo-shadow-medium);
    background: linear-gradient(135deg, var(--nintendo-red-dark) 0%, var(--nintendo-red) 100%);
}

/* Main Planner Layout */
.planner-main {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    margin-top: 24px;
}

.planner-activities {
    min-height: 500px;
}

.planner-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.full-height {
    height: 100%;
    min-height: 500px;
}

/* Add Activity Button */
.add-activity-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--nintendo-red);
    color: var(--nintendo-white);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-activity-btn:hover {
    background: #c70e15;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

.btn-icon {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Planned Activities List */
.planned-activities-list {
    padding: 20px 24px;
    min-height: 400px;
}

.no-activities {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    text-align: center;
    color: var(--nintendo-gray);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 2px solid rgba(230, 0, 18, 0.1);
    border-radius: 12px;
    background: var(--nintendo-white);
    margin-bottom: 12px;
    cursor: move;
    transition: all 0.3s ease;
}

.activity-item:hover {
    border-color: rgba(230, 0, 18, 0.3);
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.1);
}

.activity-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.activity-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.activity-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.activity-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.activity-task {
    font-weight: 600;
    color: var(--nintendo-dark);
}

.activity-count {
    color: var(--nintendo-gray);
    font-size: 0.9rem;
}

.activity-xp {
    font-weight: 700;
    color: var(--nintendo-blue);
    margin-right: 12px;
}

.activity-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 8px;
    border: 1px solid rgba(230, 0, 18, 0.3);
    border-radius: 4px;
    background: var(--nintendo-white);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(230, 0, 18, 0.1);
}

.action-btn.edit {
    color: var(--nintendo-blue);
}

.action-btn.delete {
    color: var(--nintendo-red);
}

/* Summary Cards */
.summary-content {
    padding: 20px 24px;
}

.summary-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(230, 0, 18, 0.1);
}

.summary-stat:last-child {
    border-bottom: none;
}

.summary-stat.highlight {
    background: rgba(230, 0, 18, 0.05);
    margin: 0 -24px;
    padding: 12px 24px;
    border-radius: 8px;
}

.stat-label {
    font-weight: 600;
    color: var(--nintendo-dark);
}

/* Lucky Egg specific stat values */
.lucky-egg-content .stat-value {
    font-weight: 700;
    color: var(--nintendo-blue);
    font-size: 1.1rem;
}

.lucky-egg-content .summary-stat.highlight .stat-value {
    color: var(--nintendo-red);
    font-size: 1.2rem;
}

/* Lucky Egg Optimizer */
.lucky-egg-content {
    padding: 20px 24px;
}

.friend-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.optimizer-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.optimizer-stat input {
    width: 60px;
    padding: 6px 8px;
    border: 2px solid rgba(230, 0, 18, 0.2);
    border-radius: 6px;
    background: var(--nintendo-white);
    color: var(--nintendo-dark);
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

.optimizer-recommendation {
    padding: 16px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    color: var(--nintendo-dark);
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

/* Limits */
.limits-content {
    padding: 20px 24px;
}

.limit-item {
    margin-bottom: 16px;
}

.limit-item:last-child {
    margin-bottom: 0;
}

.limit-label {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: var(--nintendo-dark);
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.limit-value {
    color: var(--nintendo-gray);
    font-size: 0.85rem;
}

.limit-bar {
    width: 100%;
    height: 6px;
    background: rgba(230, 0, 18, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.limit-fill {
    height: 100%;
    background: var(--nintendo-red);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.limit-fill.warning {
    background: #ffa500;
}

.limit-fill.danger {
    background: #ff4757;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--nintendo-white);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid rgba(230, 0, 18, 0.1);
    background: rgba(230, 0, 18, 0.02);
}

.modal-header h3 {
    margin: 0;
    color: var(--nintendo-dark);
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--nintendo-gray);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--nintendo-red);
}

.modal-body {
    padding: 24px;
}

.activity-step {
    margin-bottom: 20px;
}

.activity-step label {
    display: block;
    font-weight: 600;
    color: var(--nintendo-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.activity-step select,
.activity-step input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(230, 0, 18, 0.2);
    border-radius: 8px;
    background: var(--nintendo-white);
    color: var(--nintendo-dark);
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.activity-step select:focus,
.activity-step input:focus {
    outline: none;
    border-color: var(--nintendo-red);
}

.activity-step select:disabled,
.activity-step input:disabled {
    background: rgba(248, 249, 250, 0.8);
    color: var(--nintendo-gray);
    cursor: not-allowed;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-input input {
    width: 100%;
    text-align: center;
    border: 1px solid rgba(230, 0, 18, 0.3);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
}

.quantity-label {
    color: var(--nintendo-gray);
    font-size: 0.9rem;
    font-weight: 600;
}

.activity-preview {
    margin-top: 20px;
    padding: 16px;
    background: rgba(230, 0, 18, 0.05);
    border-radius: 8px;
    border: 2px solid rgba(230, 0, 18, 0.1);
}

.preview-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-label {
    font-weight: 600;
    color: var(--nintendo-dark);
}

.preview-xp {
    font-weight: 700;
    color: var(--nintendo-red);
    font-size: 1.1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 2px solid rgba(230, 0, 18, 0.1);
    background: rgba(248, 249, 250, 0.5);
}

.btn-secondary,
.btn-primary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-secondary {
    background: var(--nintendo-white);
    color: var(--nintendo-gray);
    border-color: rgba(230, 0, 18, 0.2);
}

.btn-secondary:hover {
    background: rgba(248, 249, 250, 0.8);
    border-color: rgba(230, 0, 18, 0.3);
}

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

.btn-primary:hover:not(:disabled) {
    background: #c70e15;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

.btn-primary:disabled {
    background: var(--nintendo-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .planner-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .goals-events-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .template-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .goals-events-row {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }
    
    .goal-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .goal-percentage {
        align-self: center;
        font-size: 1.2rem;
        margin-top: 8px;
    }
    
    .template-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .goal-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .goal-input-group input {
        width: 100%;
        box-sizing: border-box;
    }
    
    .activity-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 16px;
        text-align: left;
    }
    
    .activity-info {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
        flex-wrap: nowrap;
    }
    
    .activity-details {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
        min-width: 0; /* Allow text to wrap properly */
    }
    
    .activity-task {
        font-size: 0.95rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .activity-count {
        font-size: 0.85rem;
        color: var(--nintendo-gray);
    }
    
    .activity-xp {
        font-size: 0.9rem;
        margin-right: 0;
        flex-shrink: 0;
        align-self: flex-start;
        white-space: nowrap;
    }
    
    .activity-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap;
    }
    
    .quantity-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        justify-content: center;
        max-width: 160px;
    }
    
    .quantity-controls button {
        flex-shrink: 0;
        min-width: 36px;
        height: 36px;
    }
    
    .quantity-input {
        text-align: center;
    }
    
    .action-btn {
        flex-shrink: 0;
        padding: 8px 12px;
        min-width: auto;
        white-space: nowrap;
    }
    
    .planner-main {
        gap: 16px;
        margin-top: 16px;
    }
    
    /* Card adjustments for mobile */
    .nintendo-card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .card-header {
        padding: 0 0 12px 0;
    }
}

@media (max-width: 640px) {
    .goals-events-row {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .goal-header-row {
        gap: 8px;
    }
    
    .goal-percentage {
        font-size: 1.1rem;
        margin-top: 6px;
    }
    
    .template-buttons {
        gap: 10px;
    }
    
    .template-card {
        padding: 12px;
        text-align: center;
    }
    
    .activity-item {
        padding: 14px;
        gap: 10px;
        border-radius: 8px;
    }
    
    .activity-info {
        gap: 10px;
        align-items: flex-start;
    }
    
    .activity-details {
        gap: 3px;
        min-width: 0;
    }
    
    .activity-task {
        font-size: 0.9rem;
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    .activity-count {
        font-size: 0.8rem;
    }
    
    .activity-xp {
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .activity-actions {
        gap: 10px;
        margin-top: 2px;
    }
    
    .quantity-controls {
        gap: 6px;
        max-width: 140px;
    }
    
    .quantity-controls button {
        padding: 6px 8px;
        min-width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .quantity-input {
        font-size: 14px;
        text-align: center;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .nintendo-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .planner-main {
        gap: 12px;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .goals-events-row {
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .goal-input-group input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .template-card h4 {
        font-size: 0.9rem;
    }
    
    .template-card p {
        font-size: 0.8rem;
    }
    
    .activity-item {
        padding: 12px;
        gap: 8px;
    }
    
    .activity-info {
        gap: 8px;
        align-items: flex-start;
    }
    
    .activity-details {
        gap: 2px;
        min-width: 0;
    }
    
    .activity-task {
        font-size: 0.85rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .activity-count {
        font-size: 0.75rem;
    }
    
    .activity-xp {
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .activity-actions {
        gap: 8px;
    }
    
    .quantity-controls {
        max-width: 120px;
        gap: 4px;
    }
    
    .quantity-controls button {
        padding: 4px 6px;
        font-size: 0.8rem;
        min-width: 28px;
        height: 28px;
    }
    
    .quantity-input {
        font-size: 12px;
    }
    
    .action-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* Progress bar styles */
.goal-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    width: 100%;
    position: relative;
}

/* Progress text container */
.goal-progress .progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
    margin-top: 4px;
    font-size: 14px;
    color: #666;
}

/* Progress bar itself */
.goal-progress .planner-progress-bar {
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.goal-progress .planner-progress-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease-in-out;
    border-radius: 10px;
    position: relative;
}

/* Ensure progress bar container is visible */
.goal-progress .planner-progress-bar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Additional protection against interference from modals or other global styles */
.planner-main .goal-progress,
.planner-main .goal-progress .planner-progress-bar,
.planner-main .goal-progress .planner-progress-fill {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.goal-progress .planner-progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.goal-progress .planner-progress-fill {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.goal-progress .progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
    margin-top: 4px;
    padding: 0 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .goal-progress {
        margin: 12px 0;
    }
    
    .goal-progress .planner-progress-bar {
        height: 16px;
    }
    
    .goal-progress .progress-text {
        font-size: 12px;
    }
}
