/**
 * Goal Achiever - Main Styles
 * Responsive design with smooth animations
 */

/* Reset and Base */
#goal-achiever-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1F2937;
    line-height: 1.6;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

#goal-achiever-app * {
    box-sizing: border-box;
}

/* Header */
.ga-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #E5E7EB;
}

.ga-header h1 {
    margin: 0;
    font-size: 2.2em;
    color: #111827;
}

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

.ga-filter-btn {
    padding: 10px 20px;
    border: 2px solid #E5E7EB;
    background: white;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ga-filter-btn:hover {
    border-color: #3B82F6;
    background: #EFF6FF;
}

.ga-filter-btn.active {
    background: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

.ga-category-filter {
    padding: 10px 15px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    margin-left: auto;
}

/* Goals Grid */
.ga-goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* Goal Card */
.ga-goal-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ga-goal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.ga-goal-card:hover .ga-goal-overlay {
    opacity: 1;
}

.ga-goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.ga-goal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.ga-goal-icon {
    font-size: 2.5em;
    line-height: 1;
}

.ga-goal-title h3 {
    margin: 0;
    font-size: 1.4em;
    color: #111827;
    font-weight: 700;
}

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

.ga-btn-icon {
    background: #F3F4F6;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ga-btn-icon:hover {
    background: #E5E7EB;
    transform: scale(1.1);
}

/* Progress Bar */
.ga-progress-container {
    margin-bottom: 15px;
}

.ga-progress-bar {
    background: #E5E7EB;
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.ga-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ga-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Progress Colors */
.ga-progress-red {
    background: linear-gradient(90deg, #EF4444, #DC2626);
}

.ga-progress-orange {
    background: linear-gradient(90deg, #F97316, #EA580C);
}

.ga-progress-yellow {
    background: linear-gradient(90deg, #EAB308, #CA8A04);
}

.ga-progress-green {
    background: linear-gradient(90deg, #22C55E, #16A34A);
}

.ga-progress-blue {
    background: linear-gradient(90deg, #3B82F6, #2563EB);
}

/* Goal Stats */
.ga-goal-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ga-stat-main {
    font-size: 1.2em;
    font-weight: 700;
    color: #111827;
}

.ga-stat-current {
    color: #3B82F6;
}

.ga-stat-separator {
    color: #9CA3AF;
    margin: 0 5px;
}

.ga-stat-target {
    color: #6B7280;
}

.ga-stat-percentage {
    font-size: 1.4em;
    font-weight: 800;
    color: #8B5CF6;
}

/* Goal Footer */
.ga-goal-footer {
    border-top: 1px solid #E5E7EB;
    padding-top: 15px;
}

.ga-footer-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.ga-footer-item {
    font-size: 0.9em;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Goal Overlay */
.ga-goal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
}

.ga-goal-overlay .ga-btn {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Empty State */
.ga-empty-state {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.ga-empty-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.ga-empty-state h2 {
    margin: 0 0 10px 0;
    font-size: 2em;
    color: #111827;
}

.ga-empty-state p {
    margin: 0 0 30px 0;
    color: #6B7280;
    font-size: 1.1em;
}

/* Buttons */
.ga-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ga-btn-primary {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.ga-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.ga-btn-secondary {
    background: #F3F4F6;
    color: #374151;
}

.ga-btn-secondary:hover {
    background: #E5E7EB;
}

.ga-btn-danger {
    background: #EF4444;
    color: white;
}

.ga-btn-danger:hover {
    background: #DC2626;
}

.ga-btn-lg {
    padding: 16px 32px;
    font-size: 1.1em;
}

/* Modals */
.ga-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.ga-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ga-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.ga-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.ga-modal-large {
    max-width: 800px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ga-modal-header {
    padding: 25px;
    border-bottom: 2px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ga-modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: #111827;
}

.ga-modal-close {
    background: #F3F4F6;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ga-modal-close:hover {
    background: #E5E7EB;
    transform: rotate(90deg);
}

.ga-modal-body {
    padding: 25px;
}

.ga-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #E5E7EB;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Forms */
.ga-form-group {
    margin-bottom: 20px;
}

.ga-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.ga-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.2s ease;
}

.ga-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ga-input-large {
    font-size: 1.4em;
    padding: 15px 20px;
    font-weight: 700;
}

.ga-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.ga-form-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 25px 0;
}

/* Icon Picker */
.ga-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ga-icon-option {
    background: #F3F4F6;
    border: 2px solid transparent;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    font-size: 1.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ga-icon-option:hover {
    background: #E5E7EB;
    transform: scale(1.1);
}

.ga-icon-option.selected {
    border-color: #3B82F6;
    background: #EFF6FF;
}

/* Button Groups */
.ga-button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ga-btn-group {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #E5E7EB;
    background: white;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ga-btn-group:hover {
    border-color: #3B82F6;
    background: #EFF6FF;
}

.ga-btn-group.active {
    background: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

/* Progress Preview */
.ga-progress-preview {
    background: #F9FAFB;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #3B82F6;
}

.ga-progress-preview h4 {
    margin: 0 0 10px 0;
    color: #374151;
}

.ga-preview-content {
    font-size: 1.1em;
}

.ga-preview-calculation {
    font-weight: 700;
    color: #111827;
    margin-bottom: 5px;
}

.ga-preview-progress {
    color: #6B7280;
}

.ga-progress-current-info {
    background: #EFF6FF;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.ga-progress-current-info > div:first-child {
    font-size: 1.2em;
    font-weight: 700;
    color: #1E40AF;
    margin-bottom: 5px;
}

.ga-progress-current-info > div:last-child {
    font-size: 1.1em;
    color: #3B82F6;
}

/* Danger Zone */
.ga-danger-zone {
    background: #FEF2F2;
    border: 2px solid #FEE2E2;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.ga-danger-zone h4 {
    margin: 0 0 15px 0;
    color: #DC2626;
}

/* Celebration Modal */
.ga-celebration {
    text-align: center;
    max-width: 500px;
}

.ga-celebration-content {
    padding: 40px;
}

.ga-celebration-emoji {
    font-size: 6em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.ga-celebration h2 {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ga-celebration p {
    font-size: 1.3em;
    color: #6B7280;
    margin: 0 0 30px 0;
}

/* Help Text */
.ga-help-text {
    font-size: 0.9em;
    color: #6B7280;
    margin: 5px 0 0 0;
}

/* Loading State */
.ga-loading {
    text-align: center;
    padding: 40px;
    color: #6B7280;
}

.ga-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #E5E7EB;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .ga-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .ga-header-right {
        width: 100%;
    }

    .ga-header-right .ga-btn {
        width: 100%;
    }

    .ga-goals-grid {
        grid-template-columns: 1fr;
    }

    .ga-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .ga-category-filter {
        margin-left: 0;
    }

    .ga-form-row {
        grid-template-columns: 1fr;
    }

    .ga-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .ga-goal-card {
        padding: 20px;
    }

    .ga-goal-title h3 {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    #goal-achiever-app {
        padding: 10px;
    }

    .ga-header h1 {
        font-size: 1.8em;
    }

    .ga-modal-body {
        padding: 15px;
    }

    .ga-celebration-emoji {
        font-size: 4em;
    }

    .ga-celebration h2 {
        font-size: 2em;
    }
}

/* Print Styles */
@media print {
    .ga-header-right,
    .ga-filters,
    .ga-goal-actions,
    .ga-goal-overlay {
        display: none !important;
    }

    .ga-goal-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #E5E7EB;
    }
}

/* Accessibility */
.ga-btn:focus,
.ga-input:focus,
.ga-filter-btn:focus {
    outline: 3px solid #3B82F6;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ga-dark-mode #goal-achiever-app {
        color: #E5E7EB;
    }

    .ga-dark-mode .ga-goal-card,
    .ga-dark-mode .ga-modal-content,
    .ga-dark-mode .ga-input {
        background: #1F2937;
        color: #E5E7EB;
        border-color: #374151;
    }

    .ga-dark-mode .ga-progress-bar {
        background: #374151;
    }
}
