/* ========================================
   UI/UX ENHANCEMENTS - Testing Branch
   ======================================== */

/* ==================== 
   1. ENHANCED RESULTS DISPLAY 
   ==================== */

.results-section {
    position: relative;
    overflow: hidden;
}

/* Make result values POP */
.result-group input[readonly] {
    font-size: 2.5em !important;
    font-weight: 700 !important;
    text-align: center !important;
    color: #4CAF50 !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    border: 2px solid #4CAF50 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2) !important;
    transition: all 0.3s ease !important;
    letter-spacing: 1px !important;
}

.dark-theme .result-group input[readonly] {
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%) !important;
    color: #66bb6a !important;
    border-color: #66bb6a !important;
    box-shadow: 0 4px 15px rgba(102, 187, 106, 0.3) !important;
}

/* Result labels with icons */
.result-group label {
    font-size: 0.95em !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #666 !important;
    margin-bottom: 10px !important;
}

.dark-theme .result-group label {
    color: #aaa !important;
}

/* Success animation when results appear */
@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-group.show-result {
    animation: resultFadeIn 0.5s ease forwards;
}

.result-group:nth-child(1).show-result {
    animation-delay: 0.1s;
}

.result-group:nth-child(2).show-result {
    animation-delay: 0.2s;
}

.result-group:nth-child(3).show-result {
    animation-delay: 0.3s;
}

/* Pulse effect on hover */
.result-group input[readonly]:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3) !important;
}

/* ==================== 
   2. MOBILE TOUCH TARGETS 
   ==================== */

@media (max-width: 768px) {
    /* Bigger buttons on mobile */
    button, .btn, .calculate-button, .reset-button {
        min-height: 48px !important;
        font-size: 16px !important;
        padding: 14px 20px !important;
        border-radius: 8px !important;
    }
    
    /* Touch-friendly inputs */
    input[type="number"], input[type="email"], input[type="password"], input[type="text"] {
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    /* Better spacing between touch elements */
    .input-group {
        margin-bottom: 20px !important;
    }
    
    /* Larger result numbers on mobile */
    .result-group input[readonly] {
        font-size: 2em !important;
        padding: 16px !important;
    }
}

/* ==================== 
   3. SUCCESS ANIMATIONS 
   ==================== */

/* Success checkmark animation */
@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.success-indicator {
    display: inline-block;
    color: #4CAF50;
    animation: successPulse 0.6s ease;
    margin-left: 8px;
}

/* Copy button success state */
.copy-button.copied {
    background-color: #4CAF50 !important;
    color: white !important;
}

.copy-button.copied::after {
    content: " ✓ Copied!";
}

/* Button hover animations */
button:not(:disabled):hover, .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

button:not(:disabled):active, .btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Calculate button special effect */
.calculate-button:not(:disabled):hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* ==================== 
   4. LOGO & BRANDING 
   ==================== */

.header h1 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1::before {
    content: "🧮";
    font-size: 1.2em;
    display: inline-block;
    animation: gentleFloat 3s ease-in-out infinite;
}

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

/* Professional tagline with green checkmarks */
.professional-tagline {
    font-size: 0.75em;
    color: #666;
    margin-top: 8px;
    padding-left: 0;
    list-style: none;
}

.dark-theme .professional-tagline {
    color: #aaa;
}

/* Green checkmark for each list item */
.professional-tagline li {
    padding-left: 20px;
    position: relative;
    line-height: 1.8;
    margin-bottom: 2px;
}

.professional-tagline li::before {
    content: "✓";
    color: #4CAF50;
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.1em;
}

/* ==================== 
   5. IMPROVED INPUT VALIDATION 
   ==================== */

/* Valid input indicator */
input[type="number"]:valid:not(:placeholder-shown) {
    border-color: #4CAF50 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234CAF50' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px !important;
}

/* Invalid input indicator */
input[type="number"]:invalid:not(:placeholder-shown) {
    border-color: #f44336 !important;
}

/* Input focus effect */
input:focus {
    outline: none;
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1) !important;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* ==================== 
   6. LOADING ANIMATION ENHANCEMENT 
   ==================== */

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

.loading-animation {
    border: 4px solid rgba(76, 175, 80, 0.1);
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* ==================== 
   7. TOAST NOTIFICATION 
   ==================== */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #4CAF50;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    z-index: 10000;
    animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 1.5em;
}

/* ==================== 
   8. SECURITY BADGES ENHANCEMENT 
   ==================== */

.security-badge {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.security-badge:hover {
    background: rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

.dark-theme .security-badge {
    background: rgba(102, 187, 106, 0.15);
    border-color: rgba(102, 187, 106, 0.3);
}

/* ==================== 
   9. RESULT VALUE COUNTER ANIMATION
   ==================== */

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

.result-value-animating {
    animation: countUp 0.5s ease;
}

/* ==================== 
   10. IMPROVED HEADER SPACING 
   ==================== */

.header {
    padding-bottom: 20px !important;
    margin-bottom: 20px !important;
}

.header h1 {
    margin-bottom: 8px !important;
}

/* ==================== 
   11. PREMIUM BADGE ENHANCEMENT 
   ==================== */

.plan-banner {
    position: relative;
    overflow: hidden;
}

.plan-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.plan-banner:hover::before {
    left: 100%;
}

/* ==================== 
   12. FAQ IMPROVEMENTS 
   ==================== */

.faq-question {
    transition: all 0.3s ease;
}

.faq-question:hover {
    background-color: rgba(76, 175, 80, 0.05);
    transform: translateX(5px);
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-question.active .faq-icon {
    transform: rotate(45deg);
}

/* ==================== 
   13. ADDITIONAL POLISH 
   ==================== */

/* Add percentage symbol to result values */
.result-group input[readonly]::after {
    content: "%";
}

/* Improve "Add More Values" button */
.expand-button {
    transition: all 0.3s ease;
    border: 2px dashed rgba(76, 175, 80, 0.3) !important;
}

.expand-button:hover {
    border-color: #4CAF50 !important;
    background-color: rgba(76, 175, 80, 0.05) !important;
    transform: translateY(-2px);
}

.expand-button.expanded {
    border-style: solid !important;
}

/* Enhance security badges layout */
.security-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Subtle background pattern for results section */
.results-section {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(76, 175, 80, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(76, 175, 80, 0.03) 0%, transparent 50%);
}

/* Add glow effect to calculate button when ready */
.calculate-button:not(:disabled) {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
}

/* Improve timestamp styling */
.calculation-timestamp {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
    text-align: center;
    margin-top: 15px;
    padding: 8px;
    background: rgba(0,0,0,0.02);
    border-radius: 6px;
}

.dark-theme .calculation-timestamp {
    background: rgba(255,255,255,0.03);
    color: #aaa;
}

/* ==================== 
   RESPONSIVE ADJUSTMENTS 
   ==================== */

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }
    
    .result-group input[readonly] {
        font-size: 1.8em !important;
    }
    
    .professional-tagline {
        font-size: 0.7em;
    }
    
    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        padding: 12px 16px;
    }
    
    .security-badges {
        gap: 8px;
    }
    
    .security-badge {
        font-size: 0.85em;
        padding: 6px 12px;
    }
}
