/* Custom CSS for Aththanagalla DS Office Website */

/* Sinhala text support */
h1, h2, h3, h4, h5, h6, p, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Specific Sinhala heading support */
.sinhala-text {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
    word-break: break-word !important;
    display: block !important;
    width: 100% !important;
}

/* Override any Bootstrap text handling */
h4.sinhala-text {
    text-overflow: clip !important;
    overflow: visible !important;
}

/* About Section Styles */
.about-image {
    text-align: center;
}

.about-image img {
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

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

/* Mobile responsive for ds-photo */
@media (max-width: 768px) {
    .about-image img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover;
        display: block;
        margin: 0 auto;
    }
}

/* Photo info styles */
.photo-info {
    text-align: center;
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(32, 144, 168, 0.1);
    border-radius: 10px;
    border-left: 4px solid #2090a8;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.photo-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2090a8;
}

.photo-info p {
    font-size: 1.1rem;
    color: #555;
    margin: 0;
    font-weight: 500;
}

/* Mobile responsive for photo info */
@media (max-width: 768px) {
    .photo-info {
        margin-top: 15px;
        padding: 12px 16px;
        width: 100%;
    }
    
    .photo-info h4 {
        font-size: 0.9rem;
    }
    
    .photo-info p {
        font-size: 1rem;
    }
}

.quote-card {
    transition: all 0.3s ease;
    border-left: 4px solid #2090a8;
}

.quote-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(32, 144, 168, 0.15) !important;
}

.quote-icon {
    opacity: 0.7;
}

.quote-card:hover .quote-icon {
    opacity: 1;
}

blockquote p {
    line-height: 1.8;
    color: #555;
}

.quote-card footer {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background-color: rgba(32, 144, 168, 0.95) !important;
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    min-height: 80px;
}

.navbar-brand {
    font-size: 1.5rem;
}

.navbar-brand img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #fff !important;
}

/* Hero Slider */


.hero-slider {
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.carousel {
    height: 100vh;
    min-height: 600px;
}

.carousel-item {
    height: 100vh;
    min-height: 600px;
}

.hero-content {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Overlay removed - slider images will show without dark overlay */

.hero-content .container {
    position: relative;
    z-index: 2;
}

.slider-logo {
    text-align: left;
}

@media (max-width: 768px) {
    .slider-logo {
        text-align: center;
    }
    
    .slider-logo-img {
        height: 150px;
        width: 150px;
    }
}

.slider-logo-img {
    height: 200px;
    width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.hero-image {
    text-align: center;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 20px;
}

.carousel-indicators {
    bottom: 30px;
}

.carousel-indicators button {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.6);
    margin: 0 6px;
    transition: all 0.3s ease;
    position: relative;
}

.carousel-indicators button:hover {
    background-color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.carousel-indicators button.active {
    background-color: #2090a8;
    border-color: #2090a8;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(32, 144, 168, 0.5);
}

/* Sectors Section */
.sector-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sector-card:hover {
    transform: translateY(-10px);
}

.sector-card .card {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sector-card .card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}

.sector-icon {
    transition: transform 0.3s ease;
}

.sector-card:hover .sector-icon {
    transform: scale(1.1);
}

.sector-card ul li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Services Section */
.service-item {
    padding: 30px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.service-icon {
    transition: transform 0.3s ease;
}

.service-item:hover .service-icon {
    transform: scale(1.1);
}

/* Contact Section */
.contact-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

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

.contact-form .form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: border-color 0.3s ease;
}

.contact-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.contact-form .btn {
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
}

/* Footer */
footer {
    margin-top: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-image i {
        font-size: 4rem !important;
    }
    
    .carousel {
        height: 70vh;
        min-height: 500px;
    }
    
    .carousel-item {
        height: 70vh;
        min-height: 500px;
    }
    
    .sector-card {
        margin-bottom: 20px;
    }
    
    .service-item {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .hero-image i {
        font-size: 3rem !important;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
        margin: 0 10px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Section Animations */
.sector-card,
.service-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Stagger animation for cards */
.sector-card:nth-child(1) { animation-delay: 0.1s; }
.sector-card:nth-child(2) { animation-delay: 0.2s; }
.sector-card:nth-child(3) { animation-delay: 0.3s; }
.sector-card:nth-child(4) { animation-delay: 0.4s; }
.sector-card:nth-child(5) { animation-delay: 0.5s; }
.sector-card:nth-child(6) { animation-delay: 0.6s; }

.service-item:nth-child(1) { animation-delay: 0.1s; }
.service-item:nth-child(2) { animation-delay: 0.2s; }
.service-item:nth-child(3) { animation-delay: 0.3s; }
.service-item:nth-child(4) { animation-delay: 0.4s; }

/* Button Hover Effects */
.btn-primary {
    background: linear-gradient(135deg, #2090a8 0%, #1a7a8f 100%);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(32, 144, 168, 0.4);
}

/* Card Hover Effects */
.card {
    transition: all 0.3s ease;
}

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

/* Text Selection */
::selection {
    background: #2090a8;
    color: white;
}

/* Loading Animation */
.loading {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.loaded {
    opacity: 1;
}

/* Divisions Section */
.division-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

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

.division-card .card {
    border-radius: 15px;
    overflow: hidden;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.division-card .card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.division-header {
    background: linear-gradient(135deg, #2090a8 0%, #1a7a8f 100%);
    color: white;
    padding: 15px;
    text-align: center;
}

.division-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.division-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

.division-officers {
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.division-officers::-webkit-scrollbar {
    width: 4px;
}

.division-officers::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.division-officers::-webkit-scrollbar-thumb {
    background: #2090a8;
    border-radius: 2px;
}

.officer-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

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

.officer-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.contact-item i {
    color: #2090a8;
    width: 16px;
    text-align: center;
}

.search-box {
    position: relative;
}

.search-box .form-control:focus {
    border-color: #2090a8;
    box-shadow: 0 0 0 0.2rem rgba(32, 144, 168, 0.25);
}

.search-box .input-group-text {
    border-right: none;
}

.search-box .form-control {
    border-left: none;
}

.search-box .form-control:focus + .input-group-text {
    border-color: #2090a8;
}

/* Loading Animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* No Results Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.no-results-animation {
    animation: fadeInUp 0.6s ease;
}

/* Division Grid Animation */
.division-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.division-card:nth-child(1) { animation-delay: 0.1s; }
.division-card:nth-child(2) { animation-delay: 0.2s; }
.division-card:nth-child(3) { animation-delay: 0.3s; }
.division-card:nth-child(4) { animation-delay: 0.4s; }
.division-card:nth-child(5) { animation-delay: 0.5s; }
.division-card:nth-child(6) { animation-delay: 0.6s; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #2090a8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a7a8f;
}

/* Clickable division card styles */
.division-card-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.division-card-clickable:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(32, 144, 168, 0.2);
}

.division-card-clickable .card-footer {
    background: linear-gradient(135deg, rgba(32, 144, 168, 0.05), rgba(32, 144, 168, 0.1));
    border-top: 1px solid rgba(32, 144, 168, 0.2);
    transition: all 0.3s ease;
}

.division-card-clickable:hover .card-footer {
    background: linear-gradient(135deg, rgba(32, 144, 168, 0.1), rgba(32, 144, 168, 0.15));
    color: #2090a8;
}

.division-card-clickable:hover .card-footer small {
    color: #2090a8 !important;
    font-weight: 500;
}

/* Advanced Controls Styles */
.advanced-controls {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(32, 144, 168, 0.1);
}

.advanced-controls .btn-group .btn {
    border-radius: 8px;
    transition: all 0.3s ease;
}

.advanced-controls .btn-group .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.advanced-controls .btn-group .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.advanced-controls .btn-group .btn:not(:first-child):not(:last-child) {
    border-radius: 0;
    border-left: none;
}

.advanced-controls .btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.advanced-controls .btn-outline-primary {
    border-color: #2090a8;
    color: #2090a8;
}

.advanced-controls .btn-outline-primary:hover,
.advanced-controls .btn-outline-primary:focus {
    background-color: #2090a8;
    border-color: #2090a8;
    color: white;
}

.advanced-controls .btn-outline-primary.active {
    background-color: #2090a8;
    border-color: #2090a8;
    color: white;
}

/* Empty State Styles */
.empty-state {
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 2px dashed rgba(32, 144, 168, 0.3);
    transition: all 0.3s ease;
}

.empty-state:hover {
    border-color: rgba(32, 144, 168, 0.5);
    background: rgba(255, 255, 255, 0.9);
}

.empty-state i {
    color: #2090a8 !important;
    opacity: 0.6;
}

.empty-state h4 {
    color: #2090a8 !important;
    font-weight: 600;
}

.empty-state p {
    color: #6c757d !important;
    font-size: 1rem;
}

/* Loading State Styles */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .advanced-controls {
        padding: 15px;
    }
    
    .advanced-controls .d-flex {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .advanced-controls .d-flex .btn {
        width: 100%;
    }
}

/* News Section Styles */
.news-card {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    position: relative;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.news-date {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    align-items: center;
}

.news-type-badge {
    flex-shrink: 0;
}

.news-type-badge .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 20px;
}

.news-card .card-title {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #2090a8;
    font-weight: 600;
}

.news-card .card-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6c757d;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-file-preview {
    margin-top: auto;
}

.news-file-preview img {
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.news-file-preview img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.news-card .card-footer {
    background: transparent;
    border-top: 1px solid #f8f9fa;
    padding: 0.75rem 1.25rem;
}

.news-card .card-footer .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.news-card .card-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* News loading animation */
.news-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }
.news-card:nth-child(6) { animation-delay: 0.6s; }

/* File modal styles */
#fileModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#fileModal .modal-header {
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

#fileModal .modal-title {
    color: #2090a8;
    font-weight: 600;
}

#fileModal .modal-body {
    padding: 1.5rem;
    text-align: center;
}

#fileModal .modal-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#fileModal .modal-body iframe {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: white;
}

#fileModal .modal-footer {
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Responsive news styles */
@media (max-width: 768px) {
    .news-card .card-title {
        font-size: 1rem;
    }
    
    .news-card .card-text {
        font-size: 0.85rem;
        -webkit-line-clamp: 4;
    }
    
    .news-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .news-type-badge {
        align-self: flex-start;
    }
    
    .news-card .card-footer {
        padding: 0.5rem 1rem;
    }
    
    .news-card .card-footer .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 576px) {
    .news-card {
        margin-bottom: 1rem;
    }
    
    .news-card .card-body {
        padding: 1rem;
    }
    
    .news-card .card-footer {
        padding: 0.5rem 1rem;
    }
    
    #fileModal .modal-body {
        padding: 1rem;
    }
    
    #fileModal .modal-body img {
        max-height: 60vh;
    }
    
    #fileModal .modal-body iframe {
        height: 400px;
    }
} 