/* Mobile-first responsive design for Maharashtra e Journal */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a5490;
    --primary-dark: #0f3a5f;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --error-color: #d32f2f;
    --success-color: #388e3c;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

/* Body styles for login/signup pages */
body:not(:has(.mobile-nav)) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Body styles for authenticated pages */
body:has(.mobile-nav) {
    display: block;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: block;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.app-subtitle {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 400;
}

/* Form Styles */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 84, 144, 0.1);
}

.form-input::placeholder {
    color: #999;
}

.remember-me {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Button Styles */
.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.btn-login:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 84, 144, 0.3);
}

/* Footer */
.login-footer {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Validation Styles */
.validation-summary {
    background-color: #ffebee;
    color: var(--error-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    list-style: none;
}

.validation-summary ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validation-error {
    display: block;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
}

.field-validation-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Success Message */
.success-message {
    background-color: #e8f5e9;
    color: var(--success-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #c8e6c9;
}

/* Signup Link Text */
.signup-link-text {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-light);
}

.signup-link-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.signup-link-text a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Home Page Styles */
.home-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.home-container h1 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 24px;
}

.home-container p {
    color: var(--text-light);
    font-size: 16px;
}

/* Tablet and Desktop Responsive */
@media (min-width: 768px) {
    .login-card {
        padding: 40px 32px;
    }

    .app-title {
        font-size: 32px;
    }

    .app-subtitle {
        font-size: 16px;
    }

    .form-input {
        padding: 16px 18px;
    }

    .btn-login {
        padding: 16px;
    }
}

@media (min-width: 1024px) {
    .login-container {
        max-width: 480px;
    }

    .login-card {
        padding: 48px 40px;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .login-container {
        max-width: 400px;
    }

    .login-card {
        padding: 24px 20px;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .app-title {
        font-size: 24px;
    }

    .form-group {
        margin-bottom: 16px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus visible for keyboard navigation */
.form-input:focus-visible,
.btn-login:focus-visible,
.forgot-password-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   MOBILE NAVIGATION MENU
   ============================================ */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: var(--shadow);
    z-index: 1000;
    width: 100%;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-logo {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.mobile-nav-header > div {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.mobile-nav-header img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 32px;
    height: 32px;
    justify-content: center;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 999;
}

.mobile-menu.active {
    max-height: 500px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    font-size: 16px;
    font-weight: 500;
}

.mobile-menu-item:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.mobile-menu-item svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.mobile-menu-logout-form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.mobile-menu-logout-form button {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
}

.mobile-menu-logout {
    color: var(--error-color);
    border-top: 2px solid var(--border-color);
    margin-top: 8px;
}

.mobile-menu-logout svg {
    color: var(--error-color);
}

.mobile-menu-logout:hover {
    background-color: #ffebee;
    color: var(--error-color);
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */
.dashboard-container {
    padding: 80px 12px 16px;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 20px;
    color: #ffffff;
}

.dashboard-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.dashboard-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.search-blocks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.search-block {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 12px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 140px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.search-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.search-block:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: var(--text-color);
}

.search-block:hover::before {
    transform: scaleX(1);
}

.search-block-image {
    width: 60px;
    height: 60px;
    background: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 8px;
    transition: all 0.3s ease;
}

.search-block-blue .search-block-image {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(29, 78, 216, 0.15));
}

.search-block-green .search-block-image {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
}

.search-block-purple .search-block-image {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(124, 58, 237, 0.15));
}

.search-block-orange .search-block-image {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
}

.search-block-blue:hover .search-block-image {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(29, 78, 216, 0.25));
    transform: scale(1.05);
}

.search-block-green:hover .search-block-image {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.25));
    transform: scale(1.05);
}

.search-block-purple:hover .search-block-image {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(124, 58, 237, 0.25));
    transform: scale(1.05);
}

.search-block-orange:hover .search-block-image {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
    transform: scale(1.05);
}

.search-block-image svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
}

.search-block-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0;
    line-height: 1.3;
    margin-top: 4px;
}

.search-block-description {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   SEARCH PAGE STYLES
   ============================================ */
.search-page-container {
    padding: 80px 16px 24px;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in;
}

.search-page-header {
    text-align: center;
    margin-bottom: 32px;
    color: #ffffff;
}

.search-page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.search-page-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.search-form-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
}

.search-form {
    width: 100%;
}

.btn-search {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-search:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-search:active {
    transform: translateY(0);
}

.btn-search:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 84, 144, 0.3);
}

.back-link-container {
    text-align: center;
}

.back-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.back-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Advanced Search Form */
.advanced-search-form .form-group {
    margin-bottom: 20px;
}

.date-range-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.date-range-group .form-input {
    flex: 1;
    min-width: 140px;
}

.date-separator {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE STYLES FOR DASHBOARD
   ============================================ */
/* Very small screens - keep two columns */
@media (max-width: 479px) {
    .search-block-image {
        width: 50px;
        height: 50px;
    }
}

/* Small to large screens - always 2 columns */
@media (min-width: 480px) {
    .search-blocks {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 640px) {
    .dashboard-container {
        padding: 80px 16px 20px;
    }
    
    .search-page-container {
        padding: 80px 24px 32px;
    }
    
    .search-block-image {
        width: 70px;
        height: 70px;
    }
}

@media (min-width: 1024px) {
    .search-blocks {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .search-block {
        padding: 20px 16px;
        min-height: 160px;
    }
    
    .search-block-image {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }
    
    .search-block-title {
        font-size: 20px;
    }
    
    .search-block-description {
        font-size: 14px;
    }
    
    .dashboard-title {
        font-size: 32px;
    }
    
    .search-page-title {
        font-size: 32px;
    }
}

/* Container padding for authenticated pages */
body:has(.mobile-nav) .container {
    padding-top: 0;
}

