/* UKSMFJF Petition Website - Enhanced Styles with Smooth Animations */

:root {
    --primary-color: #2c5aa0;
    --primary-dark: #1e3d6f;
    --primary-light: #4a7bc7;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --text-color: #333;
    --text-muted: #6c757d;
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    --border-color: #e0e5ec;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Page Wrapper */
.page-wrapper {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
}

.page-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

.page-wrapper > .container {
    width: 100%;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
h1.text-primary {
    color: var(--primary-color) !important;
    letter-spacing: -0.5px;
}

/* Logo */
.header-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-logo-small {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.header-logo-small:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .header-logo {
        width: 80px;
        height: 80px;
    }

    .header-logo-small {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .header-logo {
        width: 64px;
        height: 64px;
    }
}

/* Card Styling */
.card {
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--bg-white);
    overflow: hidden;
}

.card-animated {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), opacity var(--transition-normal);
}

.card-animated:not(.d-none) {
    animation: cardSlideIn 0.4s ease forwards;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Content Sections */
.content-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.content-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

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

.highlight-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.05rem;
}

.styled-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.styled-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.list-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.info-list {
    padding-left: 1.5rem;
}

.info-list li {
    margin-bottom: 0.5rem;
}

.signature-block {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: var(--border-radius-sm);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

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

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

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

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

.btn-google {
    background-color: var(--bg-white);
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-google:hover {
    background-color: var(--bg-light);
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-sign {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-sign .btn-icon {
    transition: transform var(--transition-fast);
}

.btn-sign:hover .btn-icon {
    transform: translateX(4px);
}

.pulse-hover:hover {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(44, 90, 160, 0.35); }
    50% { box-shadow: 0 4px 20px rgba(44, 90, 160, 0.5); }
}

/* Divider */
.divider-text {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.divider-text span {
    padding: 0 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Styling */
.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15);
    outline: none;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0;
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15);
}

.form-check-label {
    padding-left: 0.25rem;
    line-height: 1.5;
}

/* Search Select Dropdown */
.search-select-wrapper {
    position: relative;
}

.search-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.search-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232c5aa0' viewBox='0 0 24 24'%3E%3Cpath d='M7 14l5-5 5 5z'/%3E%3C/svg%3E");
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-md);
}

.search-dropdown.show {
    display: block;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-dropdown-item:hover,
.search-dropdown-item.highlighted {
    background-color: var(--bg-light);
}

.search-dropdown-item.selected {
    background-color: rgba(44, 90, 160, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.search-dropdown-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* OTP Input */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.otp-digit:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15);
    outline: none;
}

.otp-digit.filled {
    border-color: var(--primary-color);
    background-color: rgba(44, 90, 160, 0.05);
}

.otp-digit.error {
    border-color: #dc3545;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success/Info Icons */
.success-icon-wrapper, .info-icon-wrapper {
    display: flex;
    justify-content: center;
}

.success-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #d4edda;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success-color);
    animation: scaleIn 0.5s ease;
}

.info-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #d1ecf1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--info-color);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Signature Count Box */
.signature-count-box {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    display: inline-block;
}

.signature-count-box .count-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.signature-count-box .spinner-border {
    width: 2rem;
    height: 2rem;
    color: #fff;
}

.signature-count-box .count-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 768px) {
    .signature-count-box .count-number {
        font-size: 2rem;
    }

    .signature-count-box .count-label {
        font-size: 0.8rem;
    }
}

/* Read More Button */
.read-more-btn {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.read-more-btn:hover {
    color: var(--primary-dark);
    background-color: rgba(44, 90, 160, 0.08);
    text-decoration: none;
}

.read-more-btn:focus {
    box-shadow: none;
    outline: none;
}

.read-more-btn .arrow-icon {
    transition: transform var(--transition-fast);
}

.read-more-btn[aria-expanded="true"] .arrow-icon,
.read-more-btn.expanded .arrow-icon {
    transform: rotate(180deg);
}

/* Full Content Expand Animation */
.full-content {
    animation: fadeInContent 0.4s ease forwards;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lead text styling for intro */
.lead {
    font-size: 1.05rem;
    color: var(--text-color);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .lead {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.5rem !important;
    }

    .highlight-text {
        font-size: 0.9rem;
    }

    .read-more-btn {
        font-size: 0.85rem;
        padding: 0.35rem 0.75rem;
    }
}

/* Alerts */
.alert {
    border-radius: var(--border-radius-sm);
    border: none;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    animation: alertSlide 0.3s ease;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--primary-color);
}

.back-link svg {
    transition: transform var(--transition-fast);
}

.back-link:hover svg {
    transform: translateX(-3px);
}

/* Loading States */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

/* Footer */
footer {
    font-size: 0.85rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .card-body {
        padding: 1.25rem !important;
    }

    h1.display-4 {
        font-size: 1.5rem;
    }

    h1.display-5 {
        font-size: 1.5rem;
    }

    .text-muted.fs-6 {
        font-size: 0.85rem !important;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .btn-sign {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        width: 100%;
    }

    .content-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

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

    .otp-digit {
        width: 42px;
        height: 50px;
        font-size: 1.25rem;
    }

    .otp-inputs {
        gap: 0.35rem;
    }

    .success-circle, .info-circle {
        width: 70px;
        height: 70px;
    }

    .success-circle svg, .info-circle svg {
        width: 36px;
        height: 36px;
    }

    .search-dropdown {
        max-height: 180px;
    }

    /* Compact home page */
    header.mb-4 {
        margin-bottom: 0.75rem !important;
    }

    header .mb-3 {
        margin-bottom: 0.5rem !important;
    }

    header .mb-2 {
        margin-bottom: 0.25rem !important;
    }

    .signature-count-box {
        padding: 0.875rem 1.25rem;
    }

    .signature-count-box .count-number {
        font-size: 1.75rem;
    }

    .signature-count-box .count-label {
        font-size: 0.75rem;
    }

    footer {
        margin-top: 1rem !important;
    }

    footer .small {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .card-body {
        padding: 1rem !important;
    }

    h1.display-4 {
        font-size: 1.35rem;
    }

    .lead {
        font-size: 0.85rem;
        line-height: 1.45;
    }

    .highlight-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 375px) {
    .otp-digit {
        width: 38px;
        height: 46px;
        font-size: 1.1rem;
    }

    .row .col-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    h1.display-4 {
        font-size: 1.25rem;
    }

    .signature-count-box .count-number {
        font-size: 1.5rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .search-dropdown-item:hover {
        background-color: transparent;
    }

    .search-dropdown-item:active {
        background-color: var(--bg-light);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --bg-light: #1a1a2e;
        --bg-white: #16213e;
        --text-color: #e0e0e0;
        --text-muted: #a0a0a0;
        --border-color: #2a2a4a;
    }
    */
}

/* Language Selector Dropdown */
.lang-selector {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
}

.lang-selector-btn {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-selector-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.lang-selector-btn .lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-selector-btn .lang-arrow {
    font-size: 0.7rem;
    transition: transform var(--transition-fast);
}

.lang-selector.open .lang-selector-btn .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    min-width: 140px;
    display: none;
    overflow: hidden;
}

.lang-selector.open .lang-dropdown {
    display: block;
    animation: dropdownSlide 0.2s ease;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-size: 0.85rem;
}

.lang-option:hover {
    background-color: var(--bg-light);
}

.lang-option.active {
    background-color: rgba(44, 90, 160, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.lang-option .lang-flag {
    font-size: 1.1rem;
}

/* Malayalam Font Support */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&display=swap');

.lang-ml {
    font-family: 'Noto Sans Malayalam', 'Inter', sans-serif;
}

.lang-ml .lead,
.lang-ml p,
.lang-ml li,
.lang-ml .form-label,
.lang-ml .form-check-label,
.lang-ml .btn,
.lang-ml h4,
.lang-ml h5 {
    line-height: 1.8;
}

.lang-ml .signature-count-box .count-label {
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .lang-selector {
        top: 10px;
        right: 10px;
    }

    .lang-selector-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .lang-ml .lead {
        font-size: 0.85rem;
        line-height: 1.7;
    }
}

/* Print Styles */
@media print {
    .page-loader,
    .btn,
    footer,
    .lang-selector {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}
