/**
 * Agreement Manager - Calculator CSS - ULTRA COMPACT VERSION
 * Path: public/css/calculator-style.css1
 * 
 * REPLACE ENTIRE FILE WITH THIS CODE
 */

/* Container - Ultra compact */
.am-calculator-container {
    max-width: 750px;
    margin: 15px auto;
    padding: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.am-calculator-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* Header - Minimal */
.am-calc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px 15px;
    text-align: center;
    color: white;
}

.am-calc-header h2 {
    margin: 0 0 3px 0;
    font-size: 22px;
    font-weight: 700;
}

.am-calc-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Form Sections - Minimal spacing */
.am-calc-form {
    padding: 15px;
}

.am-calc-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.am-calc-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.am-calc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.am-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Form Layout - Ultra compact grid */
.am-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.am-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.am-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.am-input {
    padding: 8px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    font-size: 13px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.am-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.am-input:read-only {
    background: #f5f5f5;
    cursor: not-allowed;
}

.am-help-text {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

/* Radio Cards - Minimal */
.am-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.am-radio-card {
    position: relative;
    cursor: pointer;
}

.am-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.am-radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
}

.am-radio-card:hover .am-radio-content {
    border-color: #667eea;
    background: #f8f9ff;
}

.am-radio-card input[type="radio"]:checked + .am-radio-content {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.am-radio-icon {
    font-size: 24px;
}

.am-radio-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* Rental Period Styles - Minimal */
.rental-period {
    background: #f8f9ff;
    border: 1px solid #e0e5ff;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.rental-period:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.rental-period-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e5ff;
}

.rental-period-header h4 {
    margin: 0;
    color: #667eea;
    font-size: 13px;
    font-weight: 700;
}

.remove-period {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.remove-period:hover {
    background: #ee2c3c;
    transform: rotate(90deg);
}

.rental-period-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.period-info {
    margin-top: 8px;
    padding: 6px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    color: #667eea;
}

.am-btn-add-period {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: white;
    border: 1px dashed #667eea;
    border-radius: 5px;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.am-btn-add-period:hover {
    background: #f8f9ff;
    border-style: solid;
}

.validation-error {
    background: #fee;
    border-left: 3px solid #f44;
    padding: 8px 10px;
    margin-top: 8px;
    border-radius: 3px;
    color: #c00;
    font-weight: 600;
    font-size: 12px;
}

.has-error {
    border-color: #f44 !important;
}

/* Checkbox Cards - Minimal */
.am-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.am-checkbox-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.am-checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.am-checkbox-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
}

.am-checkbox-card:hover .am-checkbox-content {
    border-color: #667eea;
    background: #f8f9ff;
}

.am-checkbox-card input[type="checkbox"]:checked + .am-checkbox-content {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.am-checkbox-card input[type="checkbox"]:checked + .am-checkbox-content::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Required/Disabled checkboxes */
.am-checkbox-required {
    cursor: default !important;
}

.am-checkbox-required .am-checkbox-content {
    border-color: #4CAF50 !important;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(56, 142, 60, 0.1) 100%) !important;
    opacity: 1 !important;
}

.am-checkbox-required input[type="checkbox"]:disabled + .am-checkbox-content::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: #4CAF50 !important;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.am-checkbox-required:hover .am-checkbox-content {
    border-color: #4CAF50 !important;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.12) 0%, rgba(56, 142, 60, 0.12) 100%) !important;
}

.am-service-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.am-service-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.am-service-info strong {
    font-size: 12px;
    color: #333;
}

.am-service-info small {
    font-size: 10px;
    color: #666;
}

/* Buttons - Minimal */
.am-calc-actions {
    margin-top: 15px;
    text-align: center;
}

.am-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.am-btn-calculate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
}

.am-btn-calculate:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(102, 126, 234, 0.4);
}

.am-btn-calculate:active {
    transform: translateY(0);
}

.am-btn-calculate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.am-btn-submit {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(17, 153, 142, 0.3);
    width: 100%;
    margin-top: 12px;
}

.am-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(17, 153, 142, 0.4);
}

.am-btn-dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.25);
}

.am-btn-dashboard:hover {
    color: white;
    transform: translateY(-1px);
}

.am-btn-icon {
    font-size: 16px;
}

/* Results Section - Minimal */
.am-calc-results {
    background: #f8f9ff;
    padding: 15px;
    margin-top: 15px;
    border-top: 2px solid #667eea;
}

.am-results-header {
    text-align: center;
    margin-bottom: 15px;
}

.am-results-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1a1a1a;
    font-weight: 700;
}

.am-results-body {
    background: white;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.am-result-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.am-result-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.am-result-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #667eea;
    font-weight: 700;
}

.am-result-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.am-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: #333;
}

.am-result-subitem {
    padding-left: 12px;
    font-size: 12px;
    color: #666;
}

.am-result-subtotal {
    margin-top: 5px;
    padding-top: 6px;
    border-top: 1px solid #e0e0e0;
}

.am-result-value {
    font-weight: 600;
    color: #1a1a1a;
}

.am-result-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    margin-top: 12px;
}

.am-grand-total-value {
    font-size: 24px;
    font-weight: 800;
}

/* Submit Section - Minimal */
.am-submit-section {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.am-submit-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 700;
    text-align: center;
}

/* Success Message - Minimal */
.am-success-message {
    text-align: center;
    padding: 30px 15px;
    background: white;
    border-radius: 6px;
    margin-top: 15px;
}

.am-success-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    margin: 0 auto 12px;
    box-shadow: 0 4px 16px rgba(17, 153, 142, 0.3);
}

.am-success-message h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #1a1a1a;
    font-weight: 700;
}

.am-success-message p {
    margin: 6px 0;
    font-size: 13px;
    color: #666;
}

.am-success-message p strong {
    color: #667eea;
    font-weight: 700;
}

.am-success-message .am-btn {
    margin-top: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .am-calculator-container {
        padding: 8px;
        margin: 10px auto;
    }
    
    .am-calc-header {
        padding: 15px 12px;
    }
    
    .am-calc-header h2 {
        font-size: 18px;
    }
    
    .am-calc-header p {
        font-size: 12px;
    }
    
    .am-calc-form {
        padding: 12px;
    }
    
    .am-calc-section {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    .am-calc-section-title {
        font-size: 14px;
    }
    
    .am-step-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .am-form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .am-radio-group {
        grid-template-columns: 1fr;
    }
    
    .am-services-grid {
        grid-template-columns: 1fr;
    }
    
    .rental-period-fields {
        grid-template-columns: 1fr;
    }
    
    .am-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .am-result-grand-total {
        flex-direction: column;
        gap: 6px;
        padding: 10px;
    }
    
    .am-grand-total-value {
        font-size: 20px;
    }
    
    .am-calc-results,
    .am-submit-section {
        padding: 12px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.am-calc-results,
.am-success-message {
    animation: fadeInUp 0.3s ease;
}

/* Print optimization */
@media print {
    .am-calc-header,
    .am-calc-actions,
    .am-btn,
    .am-submit-section {
        display: none !important;
    }
    
    .am-calculator-wrapper {
        box-shadow: none;
    }
    
    .am-calc-form,
    .am-calc-results {
        padding: 0;
    }
}