/**
 * Family Budget Manager - Frontend Styles with Greek Number Formatting
 * Minimal styles to inherit from WoodMart theme
 */

/* Container with subtle background */
body .fbm-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

body .fbm-container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    background: radial-gradient(circle at 20% 50%, rgba(131, 183, 53, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(111, 162, 41, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Progress Bar */
.fbm-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.fbm-progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.fbm-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.fbm-step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e0e0e0;
    color: #999;
    font-weight: bold;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.fbm-progress-step.active .fbm-step-number {
    background: var(--wd-primary-color, #83b735);
    border-color: var(--wd-primary-color, #83b735);
    color: #fff;
}

.fbm-step-title {
    display: block;
    font-size: 14px;
    color: #666;
}

.fbm-progress-step.active .fbm-step-title {
    color: #333;
    font-weight: 600;
}

/* Steps */
.fbm-step {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.fbm-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.fbm-step-heading {
    font-size: 28px;
    margin-bottom: 35px;
    color: var(--wd-title-color, #2c3e50);
    text-align: center;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.fbm-step-heading input {
    display: inline-block;
    border: none;
    border-bottom: 2px solid var(--wd-primary-color, #83b735);
    padding: 5px 10px;
    font-size: 20px;
    width: 220px;
    background: transparent;
    color: var(--wd-primary-color, #83b735);
    font-weight: 500;
    text-align: center;
}

.fbm-step-heading input:focus {
    outline: none;
    border-bottom-color: #6fa229;
}

/* Sections */
.fbm-section {
    margin-bottom: 40px;
}

.fbm-section h3 {
    font-size: 20px;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--wd-primary-color, #83b735), #6fa229);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(131, 183, 53, 0.2);
}

/* Table */
.fbm-table {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.fbm-category-group {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.fbm-category-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fbm-category-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--wd-title-color, #2c3e50);
    font-size: 16px;
    padding-left: 10px;
    border-left: 3px solid var(--wd-primary-color, #83b735);
}

.fbm-input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.fbm-input-row:hover {
    background: #f5f5f5;
}

.fbm-input-row label {
    flex: 1;
    color: #555;
    font-size: 14px;
}

/* Greek Number Input Styling - Hide spinners and enhance appearance */
.fbm-amount-input {
    width: 150px;
    padding: 10px 15px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    text-align: right;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.5px;
    /* Hide number spinners */
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}

/* Hide spinners in Webkit browsers */
.fbm-amount-input::-webkit-outer-spin-button,
.fbm-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
    display: none;
}

/* Desktop only - limit input width */
@media screen and (min-width: 769px) {
    .fbm-amount-input {
        max-width: 200px !important;
    }
}

.fbm-amount-input:focus {
    border-color: var(--wd-primary-color, #83b735);
    outline: none;
    box-shadow: 0 0 0 3px rgba(131, 183, 53, 0.1);
    background: #fafafa;
}

.fbm-amount-input:not(:placeholder-shown) {
    background: #f0f9ff;
    border-color: #b8d4e8;
    color: #2c3e50;
    font-weight: 600;
}

/* Greek number display styling */
.fbm-total,
.fbm-result-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.fbm-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    border-top: 3px solid var(--wd-primary-color, #83b735);
    margin-top: 20px;
    font-weight: 600;
    font-size: 17px;
    background: linear-gradient(to right, rgba(131, 183, 53, 0.05), rgba(131, 183, 53, 0.1));
    border-radius: 0 0 8px 8px;
}

.fbm-total {
    color: var(--wd-primary-color, #83b735);
    font-size: 20px;
    font-weight: 700;
}

/* Navigation */
.fbm-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.fbm-navigation .fbm-btn:only-child {
    margin-left: auto;
}

/* Buttons - Inherit from WoodMart */
.fbm-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fbm-btn-primary {
    background: var(--wd-primary-color, #83b735);
    color: #fff;
}

.fbm-btn-primary:hover {
    background: var(--wd-primary-color-hover, #6fa229);
}

.fbm-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.fbm-btn-secondary:hover {
    background: #e0e0e0;
}

.fbm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results */
.fbm-results-summary {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.fbm-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 16px;
}

.fbm-result-item span:first-child {
    color: #666;
}

.fbm-result-value {
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

.fbm-result-balance {
    border-top: 2px solid #ddd;
    margin-top: 10px;
    padding-top: 20px;
    font-size: 18px;
}

.fbm-result-balance .fbm-result-value {
    font-size: 24px;
}

/* Actions */
.fbm-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.fbm-actions .fbm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fbm-actions .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Modal */
.fbm-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.fbm-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.fbm-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.fbm-modal-close:hover,
.fbm-modal-close:focus {
    color: #000;
}

.fbm-modal h3 {
    margin-bottom: 20px;
    color: var(--wd-title-color, #333);
}

/* Responsive */
@media (max-width: 768px) {
    .fbm-container {
        padding: 20px 15px;
    }
    
    .fbm-progress-bar {
        margin-bottom: 30px;
    }
    
    .fbm-step-title {
        font-size: 12px;
    }
    
    .fbm-table {
        padding: 15px;
    }
    
    .fbm-input-row {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }
    
    .fbm-input-row label {
        margin-bottom: 8px;
        font-weight: 500;
    }
    
    .fbm-amount-input {
        width: 100% !important;
        max-width: none !important;
        text-align: left;
        font-size: 16px; /* Prevent zoom on mobile */
    }
    
    .fbm-navigation {
        flex-direction: column;
    }
    
    .fbm-actions {
        flex-direction: column;
    }
    
    .fbm-actions .fbm-btn {
        width: 100%;
        justify-content: center;
    }
    
    .fbm-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

/* Compact Layout Option */
.fbm-layout-compact .fbm-table {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.fbm-layout-compact .fbm-category-group {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    margin-bottom: 0;
}

.fbm-layout-compact .fbm-input-row {
    background: transparent;
    padding: 5px 0;
}

.fbm-layout-compact .fbm-input-row:hover {
    background: #f9f9f9;
}

@media (min-width: 992px) {
    .fbm-layout-compact .fbm-table {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fbm-layout-compact .fbm-total-row {
        grid-column: 1 / -1;
    }
}

/* Alternative Card Layout */
.fbm-layout-cards .fbm-category-group {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.fbm-layout-cards .fbm-category-group::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    margin: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--wd-primary-color, #83b735), #6fa229);
    opacity: 0;
    transition: opacity 0.3s;
}

.fbm-layout-cards .fbm-category-group:hover::before {
    opacity: 0.1;
}