/**
 * Agreement Manager - Calculator CSS
 * Path: public/css/calculator-style.css
 */

/* Container */
.am-calculator-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.am-calculator-wrapper {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.am-calc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.am-calc-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
}

.am-calc-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Form Sections */
.am-calc-form {
    padding: 30px;
}

.am-calc-section {
    margin-bottom: 35px;
    padding-bottom: 35px;
    border-bottom: 2px solid #f0f0f0;
}

.am-calc-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.am-calc-section-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.am-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
}

/* Form Layout */
.am-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.am-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.am-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.am-input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.am-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.am-input:read-only {
    background: #f5f5f5;
    cursor: not-allowed;
}

.am-help-text {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* Radio Cards */
.am-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.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: 10px;
    padding: 20px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    transition: all 0.3s 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 4px 12px rgba(102, 126, 234, 0.2);
}

.am-radio-icon {
    font-size: 36px;
}

.am-radio-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Rental Period Styles */
.rental-period {
    background: #f8f9ff;
    border: 2px solid #e0e5ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.rental-period:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.rental-period-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e5ff;
}

.rental-period-header h4 {
    margin: 0;
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
}

.remove-period {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.remove-period:hover {
    background: #ee2c3c;
    transform: rotate(90deg);
}

.rental-period-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.period-info {
    margin-top: 15px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    color: #667eea;
}

.am-btn-add-period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px dashed #667eea;
    border-radius: 8px;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.am-btn-add-period:hover {
    background: #f8f9ff;
    border-style: solid;
}

.validation-error {
    background: #fee;
    border-left: 4px solid #f44;
    padding: 12px 15px;
    margin-top: 15px;
    border-radius: 4px;
    color: #c00;
    font-weight: 600;
    font-size: 14px;
}

.has-error {
    border-color: #f44 !important;
}

/* Rent Cards */
.am-rent-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.am-rent-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border: 2px solid #e0e5ff;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.am-rent-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.am-rent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.am-year-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.am-months-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

/* Checkbox Cards */
.am-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.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: 15px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s 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 4px 12px rgba(102, 126, 234, 0.2);
}

.am-checkbox-card input[type="checkbox"]:checked + .am-checkbox-content::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.am-service-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.am-service-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.am-service-info strong {
    font-size: 15px;
    color: #333;
}

.am-service-info small {
    font-size: 13px;
    color: #666;
}

/* Buttons */
.am-calc-actions {
    margin-top: 30px;
    text-align: center;
}

.am-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.am-btn-calculate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.am-btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.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 6px 20px rgba(17, 153, 142, 0.4);
    width: 100%;
    margin-top: 20px;
}

.am-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.5);
}

.am-btn-dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.am-btn-dashboard:hover {
    color: white;
    transform: translateY(-2px);
}

.am-btn-icon {
    font-size: 20px;
}

/* Results Section */
.am-calc-results {
    background: #f8f9ff;
    padding: 30px;
    margin-top: 30px;
    border-top: 3px solid #667eea;
}

.am-results-header {
    text-align: center;
    margin-bottom: 30px;
}

.am-results-header h3 {
    margin: 0;
    font-size: 26px;
    color: #1a1a1a;
    font-weight: 700;
}

.am-results-body {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.am-result-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.am-result-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.am-result-section h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #667eea;
    font-weight: 700;
}

.am-result-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.am-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
    color: #333;
}

.am-result-subitem {
    padding-left: 20px;
    font-size: 14px;
    color: #666;
}

.am-result-subtotal {
    margin-top: 8px;
    padding-top: 12px;
    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: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin-top: 25px;
}

.am-grand-total-value {
    font-size: 32px;
    font-weight: 800;
}

/* Submit Section */
.am-submit-section {
    margin-top: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.am-submit-section h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #1a1a1a;
    font-weight: 700;
    text-align: center;
}

/* Success Message */
.am-success-message {
    text-align: center;
    padding: 60px 30px;
    background: white;
    border-radius: 12px;
    margin-top: 30px;
}

.am-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.4);
}

.am-success-message h3 {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: #1a1a1a;
    font-weight: 700;
}

.am-success-message p {
    margin: 10px 0;
    font-size: 16px;
    color: #666;
}

.am-success-message p strong {
    color: #667eea;
    font-weight: 700;
}

.am-success-message .am-btn {
    margin-top: 25px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .am-calculator-container {
        padding: 15px;
        margin: 20px auto;
    }
    
    .am-calc-header {
        padding: 30px 20px;
    }
    
    .am-calc-header h2 {
        font-size: 24px;
        color: #ffffff;
    }
    
    .am-calc-form {
        padding: 20px;
    }
    
    .am-calc-section-title {
        font-size: 18px;
        flex-wrap: wrap;
    }
    
    .am-form-row {
        grid-template-columns: 1fr;
    }
    
    .am-radio-group {
        grid-template-columns: 1fr;
    }
    
    .am-rent-cards {
        grid-template-columns: 1fr;
    }
    
    .am-services-grid {
        grid-template-columns: 1fr;
    }
    
    .am-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .am-result-grand-total {
        flex-direction: column;
        gap: 10px;
    }
    
    .am-grand-total-value {
        font-size: 28px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.am-calc-results,
.am-success-message {
    animation: fadeInUp 0.5s ease;
}