/* 
 * BharApp Main Styles
 * A complete responsive stylesheet for the BharApp website
 * Supports dark mode, accessibility, and mobile-first design
 */

:root {
    --primary-color: #1e3a8a;
    --primary-dark: #1e40af;
    --secondary-color: #dc2626;
    --accent-saffron: #f59e0b;
    --accent-green: #059669;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 6px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #1e40af;
    --primary-dark: #1d4ed8;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --border-color: #4b5563;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    z-index: 10000;
    font-size: 14px;
}

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

/* Header & Navigation */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-saffron), var(--accent-green), var(--primary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dark-mode-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.dark-mode-btn:hover {
    background: var(--bg-tertiary);
}

.light-icon {
    display: block;
}

.dark-icon {
    display: none;
}

[data-theme="dark"] .light-icon {
    display: none;
}

[data-theme="dark"] .dark-icon {
    display: block;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 3rem;
    width: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: pan-y;
}

.slider-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 2rem;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

.slide.active {
    opacity: 1;
}

.slide-1 {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-green));
}

.slide-2 {
    background: linear-gradient(135deg, var(--accent-saffron), var(--primary-color));
}

.slide-3 {
    background: linear-gradient(135deg, var(--accent-green), var(--primary-color));
}

.slide-content {
    max-width: 800px;
    width: 100%;
    padding: 0 1rem;
    z-index: 2;
    position: relative;
}

.slide-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 600;
}

.slide-description {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.slider-controls {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.slider-dots {
    display: flex;
    gap: 0.5rem;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-dot::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.slider-dot.active::before {
    background: white;
    transform: scale(1.2);
}

.slider-dot:hover::before {
    background: rgba(255, 255, 255, 0.8);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    touch-action: manipulation;
}

.slider-arrow:hover,
.slider-arrow:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

.slider-arrow:active {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(0.95);
}

.slider-arrow.prev {
    left: 2rem;
}

.slider-arrow.next {
    right: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

/* Sections */
.section {
    padding: 2.5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.app-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

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

.app-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.app-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.app-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.app-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.category-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.app-platforms {
    margin: 1rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Search and Filters */
.apps-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    min-width: 150px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

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

.footer-section ul {
    list-style: none;
}

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

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-credits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Page Headers */
.page-header {
    text-align: center;
    padding: 2rem 0;
    background: var(--bg-secondary);
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Legal Pages */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.legal-section ul {
    margin-left: 2rem;
    margin-top: 1rem;
}

.legal-section li {
    margin-bottom: 0.5rem;
}

/* Contact Form */
.contact-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

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

/* Hidden honeypot field */
.honeypot {
    display: none;
}

/* Success message */
.success-message {
    background: var(--accent-green);
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

.success-message.show {
    display: block;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* App Detail Page */
.app-detail-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.app-detail-icon {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.app-detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.app-detail-platforms {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.platform-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.app-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.app-section {
    margin-bottom: 3rem;
}

.app-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.howto-steps {
    list-style: none;
    counter-reset: step-counter;
}

.howto-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.howto-steps li:last-child {
    border-bottom: none;
}

.howto-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.screenshot {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .slide-title {
        font-size: 2.5rem;
    }
    
    .app-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .app-detail-icon {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        flex-direction: column;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero-slider {
        height: 300px;
        margin-bottom: 2rem;
        border-radius: 0;
    }

    .slide {
        padding: 1rem;
        background-position: center center !important;
        background-size: cover !important;
    }

    .slide-title {
        font-size: 1.6rem;
    }

    .slide-description {
        font-size: 0.9rem;
    }

    .slider-arrow {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
        background: rgba(255, 255, 255, 0.25);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 2px solid rgba(255, 255, 255, 0.2);
    }

    .slider-arrow.prev {
        left: 0.5rem;
    }

    .slider-arrow.next {
        right: 0.5rem;
    }

    .slider-controls {
        bottom: 1rem;
    }

    .slider-dots {
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 20px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .slider-dot {
        min-width: 44px;
        min-height: 44px;
        background: transparent;
    }

    .slider-dot::before {
        width: 14px;
        height: 14px;
    }

    .apps-controls {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-controls {
        width: 100%;
    }

    .filter-select {
        flex: 1;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .app-detail-info h1 {
        font-size: 1.6rem;
    }

    .footer-credits {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Medium mobile devices */
@media (max-width: 600px) {
    .hero-slider {
        height: 280px;
        margin-bottom: 1.5rem;
    }

    .slide {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .slider-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .slider-arrow.prev {
        left: 0.25rem;
    }

    .slider-arrow.next {
        right: 0.25rem;
    }

    .slider-dots {
        padding: 0.4rem 0.8rem;
    }

    .slider-dot::before {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .hero-slider {
        height: 250px;
        margin-bottom: 1.5rem;
        border-radius: 0;
    }

    .slide {
        padding: 0.5rem;
        background-position: center center !important;
        background-size: cover !important;
    }

    .slide-content {
        max-width: 100%;
        padding: 0.5rem;
    }

    .slide-title {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .slide-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .slider-arrow.prev {
        left: 0.25rem;
    }

    .slider-arrow.next {
        right: 0.25rem;
    }

    .slider-controls {
        bottom: 0.5rem;
    }

    .slider-dots {
        gap: 0.25rem;
        padding: 0.3rem 0.6rem;
    }

    .slider-dot {
        min-width: 40px;
        min-height: 40px;
    }

    .slider-dot::before {
        width: 10px;
        height: 10px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .app-detail-header {
        padding: 1rem;
    }

    .app-detail-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .app-links {
        flex-direction: column;
    }

    .screenshots-grid {
        grid-template-columns: 1fr;
    }
}