/* Percentage Calculator Styles */
:root {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e9ecef;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius: 10px;
    --border-radius-lg: 12px;
}

.percentage-calculator-page {
    padding: 40px 0;
    background: linear-gradient(135deg, #f5f9ff 0%, #e6f0ff 100%);
    min-height: 100vh;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 15px;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Calculator Grid Layout */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.calculator-inputs {
    padding: 30px;
    border-right: 1px solid #eee;
    background: #f8fafc;
}

/* Input Groups */
.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: 2px solid #e1e4f5;
    border-radius: var(--border-radius);
    background: var(--bg-white);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

.input-group input:hover {
    border-color: #cbd5e0;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2),
                inset 0 1px 2px rgba(0, 0, 0, 0.05);
    outline: none;
    transform: translateY(-1px);
}

.input-group input::placeholder {
    color: #a0aec0;
    opacity: 1;
    font-weight: 400;
}

/* Unit Display */
.input-group .unit-display {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #5d6d7e;
    font-weight: 500;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #d6e0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 2;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.input-group:focus-within .unit-display {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.98);
}

/* Input with icons */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.input-with-icon input {
    padding-left: 45px !important;
}

.input-with-icon:focus-within i {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

/* Radio Group */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.radio-option {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #2c3e50;
}

.radio-option:hover {
    background: #f1f7fe;
    border-color: #b8d9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #3498db;
}

/* Input Groups */
.input-group {
    margin-bottom: 25px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.input-with-button {
    display: flex;
    gap: 10px;
}

.input-with-button .form-control {
    flex: 1;
}

.btn-group {
    display: flex;
    gap: 5px;
}

/* Results Section */
.calculator-results {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.initial-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.initial-state .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #e9ecef;
}

.result-container {
    min-height: 200px;
}

.result-box {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.result-text {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.result-formula {
    font-family: 'Courier New', monospace;
    background: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    margin: 10px 0;
    overflow-x: auto;
}

.result-explanation {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Saved Calculations */
.saved-calculations {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.saved-list {
    margin-top: 15px;
}

.saved-item {
    background: #f8f9ff;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.saved-item:hover {
    background: #eef1ff;
    transform: translateX(3px);
}

.saved-item .expression {
    font-weight: 500;
}

.saved-item .result {
    color: var(--primary-color);
    font-weight: 600;
}

/* Features Section */
.unique-features {
    margin: 50px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.feature {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

/* SEO Content */
.seo-content {
    margin-top: 50px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    line-height: 1.7;
    color: #444;
}

.seo-content h2 {
    color: #2c3e50;
    margin: 30px 0 20px;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 10px;
}

.seo-content h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.seo-content h3 {
    color: #34495e;
    margin: 25px 0 15px;
    font-size: 1.4rem;
}

.seo-content p {
    margin-bottom: 1.2em;
    font-size: 1.05rem;
    line-height: 1.7;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.example {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.example:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.example h3 {
    color: var(--primary-color);
    margin-top: 0;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.example h3 i {
    margin-right: 10px;
    font-size: 1.1em;
}

.formula-box {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
}

.formula-box h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}

/* Result Container */
.result-container {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.result-container:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.result-box {
    text-align: center;
    padding: 20px 0;
}

.result-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.2;
}

.result-formula {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    overflow-x: auto;
}

.result-explanation {
    color: #7f8c8d;
    font-size: 1rem;
    line-height: 1.6;
    margin: 15px 0;
}

.result-details {
    margin: 20px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.btn {
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    text-decoration: none;
}

.btn i {
    font-size: 0.9rem;
}

.btn-primary {
    background: #3498db;
    color: white;
    border: 2px solid #3498db;
}

.btn-primary:hover {
    background: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.btn-outline-primary:hover {
    background: rgba(52, 152, 219, 0.1);
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid #95a5a6;
    color: #7f8c8d;
}

.btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #7f8c8d;
    color: #2c3e50;
}

/* Saved Calculations */
.saved-calculations {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #e9ecef;
}

.saved-calculations h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-calculations h3 i {
    color: #3498db;
}

.saved-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.saved-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.saved-item:hover {
    transform: translateX(5px);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.05);
}

.saved-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.saved-item-title {
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    font-size: 1rem;
}

.saved-item-time {
    font-size: 0.8rem;
    color: #95a5a6;
}

.saved-item-content {
    font-size: 0.9rem;
    color: #7f8c8d;
    line-height: 1.5;
}

.saved-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-inputs {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
}

@media (max-width: 576px) {
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .tool-header h1 {
        font-size: 2rem;
    }
}

.formula-box p {
    font-family: 'Courier New', monospace;
    background: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    overflow-x: auto;
}

/* FAQ Section */
.faq {
    margin: 30px 0;
}

.faq h3 {
    color: #2c3e50;
    background: #f8f9ff;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.faq h3:before {
    content: '\f059';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    color: var(--primary-color);
}

.faq h3:hover {
    background: #f0f4ff;
}

.faq p {
    padding: 15px 20px 15px 45px;
    margin: 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    border-left: 2px solid #f0f4ff;
    border-right: 2px solid #f0f4ff;
    border-bottom: 2px solid #f0f4ff;
}

/* Responsive Design */
@media (max-width: 992px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-results {
        position: static;
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    .seo-content {
        padding: 20px 15px;
    }
    
    .seo-content h2 {
        font-size: 1.6rem;
    }
    
    .seo-content h3 {
        font-size: 1.3rem;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for results */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#resultContent {
    animation: fadeIn 0.3s ease-out;
}
