/* Custom styles for Ilaiyaraaja Film Scores Database - Musical Theme */

/* Import musical fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;900&family=Cinzel:wght@400;500;600;700&family=Lato:wght@300;400;700&display=swap');

/* Musical color palette */
:root {
    --musical-purple: #6a1b9a;
    --musical-deep-purple: #4a148c;
    --musical-gold: #ffd700;
    --musical-amber: #ffb300;
    --musical-blue: #1976d2;
    --musical-indigo: #3f51b5;
    --musical-teal: #00897b;
    --musical-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #6a1b9a 100%);
    --musical-gradient-2: linear-gradient(135deg, #6a1b9a 0%, #4a148c 50%, #667eea 100%);
    --musical-gradient-3: linear-gradient(135deg, #ffd700 0%, #ffb300 50%, #ffa000 100%);
    --musical-gradient-4: linear-gradient(135deg, #1976d2 0%, #3f51b5 50%, #6a1b9a 100%);
}

/* Body styling with musical theme */
.musical-body {
    font-family: 'Lato', sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8eaf6 50%, #f3e5f5 100%);
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
    color: #333;
}

/* Animated musical notes background */
.musical-notes-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.1;
}

.note {
    position: absolute;
    font-size: 3rem;
    color: var(--musical-purple);
    animation: float 15s infinite ease-in-out;
    opacity: 0.3;
}

.note-1 { left: 10%; top: 20%; animation-delay: 0s; }
.note-2 { left: 20%; top: 60%; animation-delay: 2s; }
.note-3 { left: 30%; top: 40%; animation-delay: 4s; }
.note-4 { left: 40%; top: 80%; animation-delay: 1s; }
.note-5 { left: 60%; top: 30%; animation-delay: 3s; }
.note-6 { left: 70%; top: 70%; animation-delay: 5s; }
.note-7 { left: 80%; top: 50%; animation-delay: 2.5s; }
.note-8 { left: 90%; top: 10%; animation-delay: 4.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(5deg); }
    50% { transform: translateY(-60px) rotate(-5deg); }
    75% { transform: translateY(-30px) rotate(3deg); }
}

/* Navbar styling */
.musical-navbar {
    background: var(--musical-gradient-1) !important;
    box-shadow: 0 4px 20px rgba(106, 27, 154, 0.3);
    padding: 1rem 0;
    position: relative;
    z-index: 1000;
}

.musical-navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M0 10 Q25 5, 50 10 T100 10" stroke="rgba(255,255,255,0.1)" fill="none" stroke-width="0.5"/></svg>') repeat-x;
    opacity: 0.3;
    pointer-events: none;
}

.musical-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.musical-brand:hover {
    transform: scale(1.05);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
}

.musical-brand i {
    color: var(--musical-gold);
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

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

.brand-text {
    display: inline-block;
    background: linear-gradient(45deg, #fff, var(--musical-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    font-family: 'Lato', sans-serif;
    margin-left: 0.5rem;
    opacity: 0.9;
}

.navbar-nav .nav-link {
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link::before {
    content: '♪';
    position: absolute;
    left: -10px;
    opacity: 0;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover::before {
    opacity: 1;
    left: 0;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    transform: translateX(5px);
}

/* Page banner */
.page-banner {
    background: var(--musical-gradient-1);
    border-radius: 15px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(106, 27, 154, 0.3);
    position: relative;
    overflow: hidden;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.page-banner h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 3.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.page-banner h1 i {
    color: var(--musical-gold);
    margin-right: 1rem;
    animation: rotate 3s infinite linear;
}

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

.page-banner .lead {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Cards styling */
.card {
    border-radius: 15px;
    border: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    position: relative;
    background: white;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--musical-gradient-1);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 50px rgba(106, 27, 154, 0.3);
}

.card-body {
    padding: 2rem;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--musical-deep-purple);
    margin-bottom: 1rem;
}

.card-text {
    font-family: 'Lato', sans-serif;
    line-height: 1.7;
    color: #555;
}

.card i {
    transition: all 0.3s ease;
}

.card:hover i {
    transform: scale(1.2) rotate(5deg);
    color: var(--musical-gold) !important;
}

/* Buttons */
.btn {
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    border-radius: 25px;
    padding: 0.6rem 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-warning {
    background: var(--musical-gradient-3);
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    border: none;
    color: white;
}

.btn-primary {
    background: var(--musical-gradient-4);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #00897b 0%, #00695c 100%);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, #00acc1 0%, #00838f 100%);
    border: none;
}

/* Table styling */
.table {
    margin-bottom: 0;
    font-family: 'Lato', sans-serif;
}

.table thead {
    background: var(--musical-gradient-1);
    color: white;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.table thead th {
    border: none;
    padding: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: #f3e5f5;
    transform: scale(1.01);
    box-shadow: 0 2px 10px rgba(106, 27, 154, 0.1);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badge styling */
.badge {
    font-size: 0.9em;
    padding: 0.5em 1em;
    border-radius: 20px;
    font-weight: 600;
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--musical-purple);
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(106, 27, 154, 0.2);
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-suggestion {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.active {
    background: linear-gradient(90deg, #f3e5f5 0%, #e1bee7 100%);
    padding-left: 20px;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion strong {
    color: var(--musical-purple);
    font-weight: 700;
}

/* Visualization Zoom Styles */
.visualization-image {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.visualization-image:hover {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(106, 27, 154, 0.3);
}

#zoomModal .modal-body {
    min-height: 80vh;
}

.zoom-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    position: relative;
}

#zoomImage {
    user-select: none;
    -webkit-user-drag: none;
}

.zoom-controls {
    display: flex;
    align-items: center;
}

.zoom-controls button {
    min-width: 40px;
    border-radius: 20px;
}

#zoomLevel {
    min-width: 50px;
    text-align: center;
    font-weight: bold;
    color: white;
}

/* Songs Modal Styles */
#songsModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

#songsModal .table {
    font-size: 0.95em;
}

#songsModal .table td {
    vertical-align: middle;
}

.songs-btn {
    transition: all 0.3s ease;
    border-radius: 20px;
}

.songs-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(106, 27, 154, 0.3);
}

.songs-btn i {
    margin-right: 5px;
}

/* Unique Home Page Feature Cards - Musical Staff Layout */
.musical-staff-container {
    position: relative;
    padding: 4rem 2rem;
    margin: 3rem 0;
    overflow: hidden;
}

.staff-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    z-index: 0;
}

.staff-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--musical-purple), transparent);
    border-top: 1px solid var(--musical-purple);
    border-bottom: 1px solid var(--musical-purple);
}

.staff-line:nth-child(1) { top: 20%; }
.staff-line:nth-child(2) { top: 35%; }
.staff-line:nth-child(3) { top: 50%; }
.staff-line:nth-child(4) { top: 65%; }
.staff-line:nth-child(5) { top: 80%; }

.feature-cards-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.feature-cards-grid.uniform-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

.feature-card-wrapper {
    position: relative;
    perspective: 1000px;
}

.feature-card {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 25px;
    padding: 2.5rem;
    box-shadow: 0 15px 50px rgba(106, 27, 154, 0.15);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    border: 3px solid transparent;
    cursor: pointer;
    height: 100%;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--musical-gradient-1);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.feature-card:hover::before {
    opacity: 0.05;
}

.feature-card:hover {
    transform: translateY(-20px) rotateY(5deg) scale(1.05);
    box-shadow: 0 25px 70px rgba(106, 27, 154, 0.3);
    border-color: var(--musical-purple);
}

.card-icon-wrapper {
    position: relative;
    z-index: 1;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.card-icon-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--musical-gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(106, 27, 154, 0.3);
    position: relative;
    transition: all 0.5s ease;
}

.card-icon-circle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: var(--musical-gradient-1);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.feature-card:hover .card-icon-circle {
    transform: scale(1.15) rotate(360deg);
    box-shadow: 0 15px 40px rgba(106, 27, 154, 0.4);
}

.feature-card:hover .card-icon-circle::before {
    opacity: 0.3;
}

.card-icon-circle i {
    font-size: 3rem;
    color: white;
    z-index: 1;
    position: relative;
}

.card-content {
    position: relative;
    z-index: 1;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-heading {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--musical-deep-purple);
    margin-bottom: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover .card-heading {
    color: var(--musical-purple);
    transform: scale(1.05);
}

.card-description {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    text-align: center;
    margin-bottom: 2rem;
    flex-grow: 1;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-btn-wrapper {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--musical-gradient-1);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    box-shadow: 0 5px 20px rgba(106, 27, 154, 0.3);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 200px;
}

.card-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.card-btn:hover::before {
    width: 300px;
    height: 300px;
}

.card-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(106, 27, 154, 0.4);
}

.card-btn i {
    transition: transform 0.3s ease;
}

.card-btn:hover i {
    transform: translateX(5px);
}

.card-note {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 4rem;
    color: var(--musical-purple);
    opacity: 0.2;
    z-index: 0;
    transition: all 0.5s ease;
    font-family: serif;
}

.feature-card:hover .card-note {
    opacity: 0.4;
    transform: rotate(15deg) scale(1.2);
    color: var(--musical-gold);
}

/* Unique positioning for each card */
.feature-card-wrapper.card-1 {
    animation: floatIn 0.8s ease-out 0.1s both;
}

.feature-card-wrapper.card-2 {
    animation: floatIn 0.8s ease-out 0.2s both;
}

.feature-card-wrapper.card-3 {
    animation: floatIn 0.8s ease-out 0.3s both;
}

.feature-card-wrapper.card-4 {
    animation: floatIn 0.8s ease-out 0.4s both;
}

.feature-card-wrapper.card-5 {
    animation: floatIn 0.8s ease-out 0.5s both;
}

.feature-card-wrapper.card-6 {
    animation: floatIn 0.8s ease-out 0.6s both;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(50px) rotateY(-20deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .feature-cards-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }
    
    .musical-staff-container {
        padding: 2rem 1rem;
    }
    
    .feature-card {
        padding: 2rem;
    }
    
    .card-icon-circle {
        width: 100px;
        height: 100px;
    }
    
    .card-icon-circle i {
        font-size: 2.5rem;
    }
    
    .card-heading {
        font-size: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .feature-cards-grid.uniform-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Ensure all cards are same size on large screens */
    .feature-card-wrapper {
        display: flex;
    }
    
    .feature-card {
        width: 100%;
    }
}

@media (min-width: 1400px) {
    /* For very large screens, show 3 columns with 2 rows */
    .feature-cards-grid.uniform-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Ensure all cards maintain same size */
    .feature-card-wrapper {
        display: flex;
    }
    
    .feature-card {
        width: 100%;
    }
}

/* Footer styling */
.musical-footer {
    background: var(--musical-gradient-2);
    color: white;
    box-shadow: 0 -5px 20px rgba(106, 27, 154, 0.2);
    position: relative;
    overflow: hidden;
}

.musical-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--musical-gold), transparent);
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-text {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.1rem;
}

.footer-subtitle {
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
}

.musical-footer i {
    color: var(--musical-gold);
    margin: 0 0.5rem;
    animation: pulse 2s infinite;
}

/* Card headers */
.card-header {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--musical-gradient-1) !important;
    border: none;
    padding: 1.5rem;
}

.card-header i {
    margin-right: 0.5rem;
    color: var(--musical-gold);
}

/* Form inputs */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1rem;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--musical-purple);
    box-shadow: 0 0 0 0.2rem rgba(106, 27, 154, 0.25);
    outline: none;
}

/* Stats cards */
.stats-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 4px solid var(--musical-purple);
    transition: all 0.3s ease;
}

.stats-card:hover {
    border-left-width: 6px;
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(106, 27, 154, 0.2);
}

/* Main container */
main.container {
    position: relative;
    z-index: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-banner h1 {
        font-size: 2rem;
    }
    
    .musical-brand {
        font-size: 1.3rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--musical-gradient-1);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--musical-deep-purple);
}
