/* Calcunex Tools - Modern Financial Calculator Website Styles */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Color Variables */
:root {
    --primary-blue: #3182ce;
    --primary-dark: #2c5282;
    --secondary-purple: #805ad5;
    --accent-green: #38a169;
    --white: #ffffff;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-500: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --gray-900: #1a202c;
    --success: #38a169;
    --warning: #ed8936;
    --error: #e53e3e;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--gray-800);
    word-wrap: break-word;
    hyphens: auto;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.section {
    padding: 4rem 0;
}

.content-wrapper {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-height: calc(100vh - 160px);
    margin: 2rem 0;
    overflow-x: hidden;
}

/* Header Styles */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary-blue);
}

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

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-blue);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: var(--gray-700);
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-blue);
    color: var(--white);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-700);
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: var(--gray-100);
    color: var(--primary-blue);
}

.mobile-menu-toggle:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-purple) 100%);
    color: var(--white);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text {
    text-align: left;
}

.hero-image {
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hero h1 {
    color: var(--white);
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 0;
    width: 100%;
    box-sizing: border-box;
}

.calculator-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

.calculator-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calculator-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.calculator-card h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.calculator-card p {
    margin-bottom: 1.5rem;
    color: var(--gray-600);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(49, 130, 206, 0.4);
}

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

.btn-secondary:hover {
    background: var(--gray-300);
}

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

.btn-success:hover {
    background: #2f855a;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Calculator Interface */
.calculator-interface {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

.calculator-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.calculator-result {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-blue);
    margin-top: 1.5rem;
}

.result-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* Features Section */
.features {
    background: var(--gray-50);
    padding: 4rem 0;
    overflow-x: hidden;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    width: 100%;
    box-sizing: border-box;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-image {
    width: 100%;
    height: 200px;
    margin: 0 auto 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-image img {
    transform: scale(1.05);
}

/* Fallback for feature icons (if images don't load) */
.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

/* Contact Section */
.contact {
    padding: 4rem 0;
    background: var(--white);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info {
    background: var(--gray-50);
    padding: 2rem;
    border-radius: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-300);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 1rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gray-900);
    color: var(--white);
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner.minimized {
    transform: translateY(calc(100% - 50px));
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-toggle {
    position: absolute;
    top: -40px;
    right: 1rem;
    background: var(--primary-blue);
    border: none;
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.3s ease;
}

.cookie-toggle:hover {
    background: var(--primary-dark);
}

/* Responsive Design */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .calculator-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Tablets */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .navbar {
        position: relative;
        padding: 0.75rem 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .calculator-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-image {
        height: 150px;
    }
    
    .mobile-menu-toggle {
        display: block;
        padding: 0.5rem;
        border-radius: 4px;
        transition: background-color 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background-color: var(--gray-100);
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-radius: 0 0 12px 12px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        gap: 0.5rem;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        text-align: center;
        width: 100%;
        display: block;
    }
    
    .hero {
        padding: 4rem 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1.125rem;
        padding: 0 1rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 0;
    }
    
    .calculator-card {
        padding: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-actions {
        justify-content: center;
    }
    
    .calculator-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calculator-interface {
        padding: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-content {
        gap: 1.5rem;
    }
    
    .calculator-icon {
        width: 50px;
        height: 50px;
    }
    
    .feature-image {
        height: 120px;
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .calculator-grid {
        gap: 1rem;
        padding: 1.5rem 0;
    }
    
    .calculator-card {
        padding: 1.25rem;
    }
    
    .calculator-card h3 {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1.25rem;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .contact-item {
        padding: 0.75rem;
    }
    
    .contact-icon {
        width: 32px;
        height: 32px;
    }
    
    .form-input {
        padding: 0.625rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .calculator-interface {
        padding: 1rem;
    }
    
    .calculator-result {
        padding: 1rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .cookie-banner {
        padding: 0.75rem;
    }
    
    .cookie-text h3 {
        font-size: 1.125rem;
    }
    
    .cookie-text p {
        font-size: 0.875rem;
    }
    
    .cookie-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-actions .btn {
        width: 100%;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .calculator-card,
    .feature-card {
        padding: 1rem;
    }
    
    .calculator-interface {
        padding: 0.75rem;
    }
    
    .form-input {
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-blue);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 6px;
}

/* Focus States */
*:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --gray-500: #000000;
        --gray-700: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Mobile-specific optimizations */
.mobile-device {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    button, 
    .btn, 
    a, 
    input, 
    select, 
    textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
}

/* Mobile viewport height fix */
:root {
    --vh: 1vh;
}

@media (max-width: 768px) {
    .hero {
        min-height: calc(var(--vh, 1vh) * 50);
    }
}

/* Improve form usability on mobile */
@media (max-width: 768px) {
    .form-input:focus {
        transform: scale(1.02);
        transition: transform 0.2s ease;
    }
    
    select.form-input {
        background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 0.7rem center;
        background-size: 0.65rem auto;
        padding-right: 2.5rem;
    }
}

/* Loading states for better UX */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-blue);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* Better button states for mobile */
@media (max-width: 768px) {
    .btn:active {
        transform: scale(0.98);
    }
    
    .calculator-card:active {
        transform: scale(0.99);
    }
    
    .feature-card:active {
        transform: scale(0.99);
    }
}
