/* Enhanced Home Page Styles - Hector Kobbekaduwa Agrarian Research and Training Institute */
:root {
    --primary-green: #4CAF50;
    --light-green: #E8F5E9;
    --medium-green: #81C784;
    --dark-green: #388E3C;
    --darker-green: #2E7D32;
    --white: #FFFFFF;
    --off-white: #F9F9F9;
    --light-gray: #F5F5F5;
    --medium-gray: #E0E0E0;
    --dark-gray: #616161;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--off-white);
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60vh;
}

/* Enhanced Hero Section */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 92, 35, 0.45), rgba(46, 125, 50, 0.55)), 
                url('../images/home.jpg') no-repeat center center/cover;
    text-align: left;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, var(--off-white), transparent);
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    position: relative;
    z-index: 2;
    animation: fadeSlideUp 1s ease-out;
}

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

.hero-text {
    padding: 40px 50px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    
    overflow: hidden;
}

.hero-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--darker-green));
}

.hero-text h2 {
    font-size: 3.2rem;
    margin-bottom: 20px;
    color: var(--darker-green);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--darker-green), var(--dark-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--dark-gray);
    width: 80%;
    line-height: 1.8;
    font-weight: 500;
    position: relative;
    padding-left: 20px;
    border-left: 4px solid var(--primary-green);
}

/* Enhanced Articles Container */
.articles-container {
    margin: 60px auto;
    max-width: 1400px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(76, 175, 80, 0.1);
}

.articles-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--medium-green), var(--dark-green));
    z-index: 1;
}

/* Enhanced Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--medium-gray);
    text-align: center;
    justify-content: center;
    gap: 30px;
    padding: 20px 20px 0;
    background: linear-gradient(to bottom, var(--white), var(--light-gray));
}

.tab-button {
    padding: 15px 40px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
    transition: var(--transition);
    position: relative;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-button i {
    font-size: 1.2rem;
    opacity: 0.7;
    transition: var(--transition);
}

.tab-button:hover {
    color: var(--dark-green);
    background: var(--light-green);
    transform: translateY(-2px);
}

.tab-button:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.tab-button.active {
    color: var(--darker-green);
    background: linear-gradient(to bottom, var(--white), var(--light-green));
    border-bottom: 3px solid var(--primary-green);
    font-weight: 700;
}

.tab-button.active i {
    opacity: 1;
    color: var(--primary-green);
}

/* Enhanced Tab Content */
.tab-content {
    padding: 40px;
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    background: var(--white);
    animation: fadeIn 0.5s ease;
}

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

/* Enhanced Article Cards */
.article {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 25px;
    max-width: 100%;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid var(--light-green);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--medium-green));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.article:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--medium-green);
}

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

.article h2 {
    font-size: 1.3rem;
    margin: 0 0 15px 0;
    color: var(--darker-green);
    font-weight: 700;
    flex-grow: 1;
    line-height: 1.4;
}

.article .author {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin: 0 0 8px 0;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article .author::before {
    content: '✍️';
    font-size: 1rem;
}

.article .date {
    font-size: 0.9rem;
    color: var(--primary-green);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.article .date::before {
    content: '📅';
    font-size: 1rem;
}

.article a.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Enhanced Research Articles Section */
.research-article-container {
    max-width: 1400px;
    margin: 80px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--darker-green);
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.section-title::after {
    content: '';
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--dark-green));
    border-radius: 2px;
}

/* Enhanced Article Cards Grid */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-card {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), rgba(46, 125, 50, 0.08));
    padding: 25px 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    gap: 20px;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.article-card:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(46, 125, 50, 0.15));
    transform: translateX(10px) translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--medium-green);
}

.article-card:hover::before {
    left: 100%;
}

.article-card:hover .icon {
    transform: rotate(5deg) scale(1.1);
}

.icon {
    width: 50px;
    height: 50px;
    margin-right: 5px;
    margin-top: 0;
    transition: var(--transition);
    filter: drop-shadow(0 4px 6px rgba(0, 92, 35, 0.2));
}

.article-info {
    flex: 1;
}

.article-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--darker-green);
    transition: var(--transition);
}

.authors-name {
    font-size: 0.95rem;
    font-weight: 500;
    font-style: italic;
    color: var(--dark-gray);
    margin: 0 0 5px 0;
}

.authors {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--dark-gray);
    margin-top: 5px;
}

.date {
    font-size: 0.9rem;
    color: var(--primary-green);
    font-style: italic;
    margin-left: 0;
    white-space: nowrap;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.date::before {
    content: '📅';
    font-size: 0.95rem;
}

/* Enhanced View More Button */
.view-more-container {
    text-align: center;
    margin-top: 40px;
}

.view-more-btn {
    padding: 16px 48px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.view-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.view-more-btn:hover {
    background: linear-gradient(135deg, var(--dark-green), var(--darker-green));
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(76, 175, 80, 0.35);
}

.view-more-btn:hover::before {
    left: 100%;
}

.view-more-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

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

.view-more-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

a {
    text-decoration: none;
    color: var(--darker-green);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-green);
}


/* Loading, No Articles, Error States */
.loading, .no-articles, .error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--dark-gray);
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--light-green), var(--white));
    border-radius: var(--radius-md);
    border: 1px solid var(--medium-green);
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 10px;
}

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

.no-articles::before {
    content: '📄';
    font-size: 3rem;
    opacity: 0.5;
}

.error {
    background: #FFEBEE;
    border-color: #EF4444;
    color: #DC2626;
}

.error::before {
    content: '⚠️';
    font-size: 2.5rem;
}

/* Responsive Styles - Enhanced for All Devices */

/* Desktop Large (1400px+) */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-text h2 {
        font-size: 3.5rem;
    }
    
    .tab-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop (1200px - 1399px) */
@media screen and (max-width: 1399px) and (min-width: 1200px) {
    .hero-text h2 {
        font-size: 3rem;
    }
    
    .tab-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* Desktop Medium (1024px - 1199px) */
@media screen and (max-width: 1199px) and (min-width: 1024px) {
    .hero {
        height: 70vh;
    }
    
    .hero-text h2 {
        font-size: 2.8rem;
    }
    
    .hero-text p {
        width: 90%;
    }
    
    .articles-container {
        margin: 40px 30px;
    }
    
    .tabs {
        gap: 80px;
    }
    
    .tab-content {
        grid-template-columns: repeat(2, 1fr);
        padding: 30px;
    }
    
    .date {
        margin-left: 400px;
    }
}

/* Tablet Landscape (768px - 1023px) */
@media screen and (max-width: 1023px) and (min-width: 768px) {
    .hero {
        height: 60vh;
        padding-top: 70px;
    }
    
    .hero-content {
        max-width: 700px;
    }
    
    .hero-text {
        padding: 35px 40px;
    }
    
    .hero-text h2 {
        font-size: 2.4rem;
        line-height: 1.3;
        -webkit-text-fill-color: var(--darker-green);
        background: none;
    }
    
    .hero-text p {
        font-size: 1.1rem;
        width: 100%;
    }
    
    .articles-container {
        margin: 40px 30px;
    }
    
    .tabs {
        gap: 40px;
        flex-wrap: wrap;
    }
    
    .tab-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .tab-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 30px;
    }
    
    .article {
        padding: 20px;
    }
    
    .article h2 {
        font-size: 1.2rem;
    }
    
    .research-article-container {
        padding: 0 30px;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .article-card {
        padding: 20px 25px;
    }
    
    .date {
        margin-left: 250px;
    }
    
    .footer {
        gap: 60px;
        padding: 30px 40px;
    }
}

/* Tablet Portrait (576px - 767px) */
@media screen and (max-width: 767px) and (min-width: 576px) {
    .hero {
        height: 55vh;
        padding-top: 60px;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .hero-text {
        text-align: center;
        padding: 30px 25px;
    }
    
    .hero-text h2 {
        font-size: 2rem;
        line-height: 1.3;
        -webkit-text-fill-color: var(--darker-green);
        background: none;
    }
    
    .hero-text p {
        font-size: 1rem;
        width: 100%;
        border-left: none;
        padding-left: 0;
    }
    
    .articles-container {
        margin: 30px 20px;
    }
    
    .tabs {
        gap: 20px;
        padding: 15px 15px 0;
    }
    
    .tab-button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .tab-content {
        grid-template-columns: 1fr;
        padding: 25px;
        gap: 20px;
    }
    
    .article {
        max-width: 100%;
    }
    
    .article h2 {
        font-size: 1.1rem;
    }
    
    .article .author {
        font-size: 0.9rem;
    }
    
    .article .date {
        font-size: 0.85rem;
    }
    
    .research-article-container {
        padding: 0 20px;
        margin: 60px auto;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }
    
    .article-card {
        padding: 18px 20px;
        gap: 15px;
    }
    
    .icon {
        width: 40px;
        height: 40px;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
    
    .authors-name {
        font-size: 0.9rem;
    }
    
    .date {
        margin-left: 0;
        white-space: normal;
        font-size: 0.85rem;
    }
    
    .date::before {
        content: '📅';
    }
    
    .view-more-btn {
        padding: 14px 40px;
        font-size: 1rem;
    }
    
    .footer {
        flex-direction: column;
        gap: 25px;
        text-align: center;
        padding: 30px 30px;
    }
    
    .footer h6 {
        justify-content: center;
    }
}

/* Mobile (480px - 575px) */
@media screen and (max-width: 575px) and (min-width: 480px) {
    .hero {
        height: 50vh;
        padding-top: 55px;
    }
    
    .hero-text {
        padding: 25px 20px;
    }
    
    .hero-text h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
        line-height: 1.3;
        -webkit-text-fill-color: var(--darker-green);
        background: none;
    }
    
    .hero-text p {
        display: block;
        font-size: 0.95rem;
    }
    
    .articles-container {
        margin: 25px 15px;
    }
    
    .tabs {
        gap: 15px;
        padding: 12px 12px 0;
    }
    
    .tab-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .tab-button i {
        display: none;
    }
    
    .tab-content {
        padding: 20px;
        gap: 15px;
    }
    
    .article {
        padding: 18px;
    }
    
    .article h2 {
        font-size: 1rem;
    }
    
    .article .author {
        font-size: 0.85rem;
    }
    
    .article .date {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .article-card {
        padding: 16px 18px;
        gap: 12px;
    }
    
    .icon {
        width: 35px;
        height: 35px;
    }
    
    .article-title {
        font-size: 1rem;
    }
    
    .authors-name,
    .authors {
        font-size: 0.85rem;
    }
    
    .date {
        font-size: 0.8rem;
    }
    
    .view-more-btn {
        padding: 12px 32px;
        font-size: 0.95rem;
    }
    
    .footer-container {
        margin-top: 60px;
        padding: 40px 0 20px;
    }
    
    .footer {
        padding: 0 20px;
        gap: 20px;
    }
    
    .footer h6 {
        font-size: 0.85rem;
    }
}

/* Small Mobile (0px - 479px) */
@media screen and (max-width: 479px) {
    .hero {
        height: 45vh;
        padding-top: 50px;
    }
    
    .hero-text {
        padding: 20px 15px;
    }
    
    .hero-text h2 {
        font-size: 1.5rem;
        margin-left: 0;
        margin-top: 0;
        line-height: 1.3;
        -webkit-text-fill-color: var(--darker-green);
        background: none;
    }
    
    .hero-text p {
        display: block;
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .articles-container {
        margin: 20px 10px;
    }
    
    .tabs {
        gap: 10px;
        padding: 10px 10px 0;
    }
    
    .tab-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .tab-button i {
        display: none;
    }
    
    .tab-content {
        padding: 15px;
        gap: 12px;
    }
    
    .article {
        padding: 15px;
    }
    
    .article h2 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .article .author {
        font-size: 0.8rem;
    }
    
    .article .date {
        font-size: 0.75rem;
    }
    
    .research-article-container {
        padding: 0 10px;
        margin: 50px auto;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }
    
    .article-card {
        padding: 14px 15px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .icon {
        width: 35px;
        height: 35px;
        margin-bottom: 5px;
    }
    
    .article-title {
        font-size: 0.95rem;
    }
    
    .authors-name,
    .authors {
        font-size: 0.8rem;
    }
    
    .date {
        font-size: 0.75rem;
        margin-top: 5px;
        white-space: normal;
    }
    
    .view-more-container {
        margin-top: 30px;
    }
    
    .view-more-btn {
        padding: 12px 28px;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
    
    .footer-container {
        margin-top: 50px;
        padding: 30px 0 15px;
    }
    
    .footer {
        padding: 0 15px;
        gap: 15px;
    }
    
    .footer h6 {
        font-size: 0.8rem;
    }
}

/* Landscape Mode */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        min-height: 500px;
    }
    
    .hero-text h2 {
        font-size: 2.2rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .hero {
        background: none;
        color: black;
        height: auto;
        padding: 30px 0;
    }
    
    .hero-text {
        box-shadow: none;
        border: 1px solid #000;
        background: white;
    }
    
    .hero-text h2 {
        -webkit-text-fill-color: black;
        background: none;
        color: black;
    }
    
    .tabs,
    .view-more-btn,
    .footer-container {
        display: none;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .article,
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-content,
    .article:hover,
    .article-card:hover,
    .view-more-btn:hover {
        transform: none !important;
    }
}