/* Enhanced UI Components */

/* Card Components */
.card {
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: none;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-primary {
    position: relative;
}

.card-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-blue);
    opacity: 0.8;
}

.card-accent::before {
    background-color: var(--accent-teal);
}

.card-secondary::before {
    background-color: var(--accent-purple);
}

.card h3 {
    color: var(--primary-blue);
    margin-top: 0;
}

.card p {
    color: var(--neutral-600);
}

/* Button Components */
.btn {
    border-radius: var(--radius-md);
    padding: 0.625rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
    border: none;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: height 0.2s ease;
    z-index: -1;
}

.btn:hover::after {
    height: 100%;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
    text-decoration: none;
}

.btn-accent {
    background-color: var(--accent-teal);
    color: white;
}

.btn-accent:hover {
    background-color: #0097a7; /* Darker teal */
    color: white;
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background-color: var(--primary-light);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--neutral-200);
    color: var(--neutral-700);
}

.btn-secondary:hover {
    background-color: var(--neutral-300);
    text-decoration: none;
}

/* Form Components */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-label {
    position: absolute;
    top: -10px;
    left: 10px;
    background-color: white;
    padding: 0 0.25rem;
    font-size: 0.875rem;
    color: var(--primary-blue);
    font-weight: 500;
    z-index: 1;
}

.form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-300);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    background-color: var(--neutral-50);
    width: 100%;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    background-color: white;
    outline: none;
}

.form-control.error {
    border-color: var(--error);
}

.form-control.success {
    border-color: var(--success);
}

.form-help-text {
    font-size: 0.875rem;
    color: var(--neutral-500);
    margin-top: 0.5rem;
}

.input-group {
    position: relative;
}

.input-group-addon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-500);
    font-weight: 500;
    pointer-events: none;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: var(--neutral-50);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    background-color: white;
    outline: none;
}

/* Result Container */
.result-container {
    background-color: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.result-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-family: 'Roboto Mono', monospace;
}

.result-explanation {
    color: var(--neutral-700);
    font-size: 1.1rem;
}

/* Calculator Cards */
.calculator-card {
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 50px 50px 0;
    border-color: transparent var(--primary-light) transparent transparent;
    z-index: -1;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.calculator-card:hover::before {
    border-color: transparent var(--primary-blue) transparent transparent;
    opacity: 0.2;
}

.calculator-card h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.calculator-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-teal);
}

.calculator-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.calculator-icon svg {
    width: 30px;
    height: 30px;
    fill: var(--primary-blue);
}

/* Navigation */
.navbar {
    background-color: white;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-blue);
    text-decoration: none;
}

.navbar-brand .logo-mark {
    width: 32px;
    height: 32px;
    margin-right: 0.5rem;
}

.nav {
    display: flex;
    align-items: center;
}

.nav-item {
    margin-left: 1.5rem;
}

.nav-link {
    color: var(--neutral-700);
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-blue);
    transition: width 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-blue);
    text-decoration: none;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* Tabs */
.calculator-tabs {
    display: flex;
    border-bottom: 1px solid var(--neutral-200);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.calculator-tabs::-webkit-scrollbar {
    display: none;
}

.calculator-tab {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: var(--neutral-600);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.calculator-tab:hover {
    color: var(--primary-blue);
}

.calculator-tab.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

/* Toggle Switch */
.calculator-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calculator-toggle-label {
    margin-right: 1rem;
    font-weight: 500;
    color: var(--neutral-700);
}

.calculator-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.calculator-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.calculator-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--neutral-300);
    transition: .4s;
    border-radius: 34px;
}

.calculator-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .calculator-toggle-slider {
    background-color: var(--primary-blue);
}

input:focus + .calculator-toggle-slider {
    box-shadow: 0 0 1px var(--primary-blue);
}

input:checked + .calculator-toggle-slider:before {
    transform: translateX(24px);
}

/* Checkbox */
.calculator-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.calculator-checkbox-input {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--neutral-400);
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calculator-checkbox-input:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.calculator-checkbox-input:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.calculator-checkbox-label {
    font-size: 0.95rem;
    color: var(--neutral-700);
    cursor: pointer;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col {
    flex: 1 0 0%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-auto {
    flex: 0 0 auto;
    width: auto;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-12 {
    flex: 0 0 auto;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-6 {
    flex: 0 0 auto;
    width: 50%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-4 {
    flex: 0 0 auto;
    width: 33.333333%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-3 {
    flex: 0 0 auto;
    width: 25%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .col-lg-6 {
        flex: 0 0 auto;
        width: 50%;
    }
    
    .col-lg-12 {
        flex: 0 0 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 auto;
        width: 50%;
    }
    
    .col-md-12 {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .calculator-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .calculator-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .col-sm-12 {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .navbar-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav {
        margin-top: 1rem;
        flex-wrap: wrap;
    }
    
    .nav-item {
        margin-left: 0;
        margin-right: 1rem;
        margin-bottom: 0.5rem;
    }
}
