/* Royal Palace Website Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Royal Color Variables */
:root {
    --royal-gold: #d4af37;
    --royal-gold-light: #f4e4bc;
    --royal-gold-dark: #b8860b;
    --royal-purple: #4a148c;
    --royal-blue: #0d47a1;
    --royal-charcoal: #1a1a1a;
    --transition: all 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--royal-gold);
    text-align: center;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    color: var(--royal-purple);
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--royal-gold);
}

h3 {
    font-size: 1.5rem;
    color: var(--royal-purple);
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.2rem;
    color: var(--royal-gold);
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.7;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Strip */
.top-strip {
    background-color: var(--royal-charcoal);
    color: white;
    padding: 8px 0;
    font-size: 0.9rem;
    text-align: center;
}

.top-strip p {
    margin: 0;
    direction: rtl;
    unicode-bidi: embed;
}

/* Header / Navigation */
.main-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    padding: 5px 10px;
    border-radius: 4px;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: var(--royal-gold);
    color: white;
}

/* Hero / Intro */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                url('../images/istana-main.jpg') center/cover no-repeat;
    padding: 100px 0;
    color: white;
    text-align: center;
}

.hero-content h2 {
    font-size: 1.8rem;
    color: var(--royal-gold);
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: 2rem;
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

.arabic-text {
    font-size: 1.5rem;
    font-family: 'Arial Unicode MS', 'Tahoma', sans-serif;
    color: var(--royal-gold);
    text-align: center;
    margin-top: 20px;
    direction: rtl;
}

/* Section Styles */
section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    margin: 0;
}

.view-all, .cta-button {
    display: inline-block;
    background-color: var(--royal-gold);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
}

.view-all:hover, .cta-button:hover {
    background-color: var(--royal-gold-dark);
    transform: translateY(-2px);
}

/* Berita Semasa (News) */
.news-section {
    background-color: white;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    transition: var(--transition);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

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

.news-image {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.news-item:hover .news-image img {
    transform: scale(1.05);
}
.news-image-container {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    height: 200px;
}

.news-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.news-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.news-item:hover .news-item-image {
    transform: scale(1.05);
}

.news-label {
    display: inline-block;
    background-color: var(--royal-gold);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.news-date {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0;
}

.read-more {
    color: var(--royal-gold);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.read-more:hover {
    text-decoration: underline;
}

.news-detail-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}

.news-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

.news-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Sejarah Kesultanan Perak (History gallery) */
.history-section {
    background-color: #f9f9f9;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.history-item {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.history-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.history-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(74, 20, 140, 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    padding: 1rem;
    text-align: center;
}

.history-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h4 {
    color: var(--royal-gold);
    margin-bottom: 0.5rem;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.photo-item img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.photo-item p {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* Timeline Styles */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--royal-gold);
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    width: 100%;
}

.timeline-item::after {
    content: '';
    display: table;
    clear: both;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-content {
    width: 45%;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.timeline-content::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: white;
    top: 30px;
    border: 3px solid var(--royal-gold);
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-content {
    float: left;
    text-align: right;
}

.timeline-item:nth-child(odd) .timeline-content::after {
    right: -20px;
}

.timeline-item:nth-child(even) .timeline-content {
    float: right;
    text-align: left;
}

.timeline-item:nth-child(even) .timeline-content::after {
    left: -20px;
}

.timeline-year {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--royal-gold);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-year {
    top: 25px;
}

.timeline-item:nth-child(even) .timeline-year {
    top: 25px;
}

.timeline-content h3 {
    margin-top: 0;
    color: var(--royal-purple);
}

.timeline-content p {
    margin-bottom: 0;
}

.timeline-image {
    margin-bottom: 15px;
}

.timeline-image img {
    width: 100%;
    border-radius: 8px;
    height: 150px;
    object-fit: cover;
}

/* Ahli Setia Diraja (Membership) */
.membership-section {
    background-color: white;
}

.arabic-subtitle {
    font-size: 1.3rem;
    font-family: 'Arial Unicode MS', 'Tahoma', sans-serif;
    color: var(--royal-gold);
    text-align: center;
    margin-bottom: 30px;
    direction: rtl;
}

.membership-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
}

.motto {
    background-color: var(--royal-gold-light);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    text-align: center;
}

.motto strong {
    color: var(--royal-purple);
}

.membership-image img {
    width: 100%;
    border-radius: 8px;
}

.royal-family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.royal-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.royal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.royal-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.royal-card-content {
    padding: 20px;
}

.royal-card-title {
    font-size: 1.2rem;
    color: var(--royal-purple);
    margin-bottom: 5px;
}

.royal-card-subtitle {
    color: var(--royal-gold);
    font-weight: 500;
    margin-bottom: 10px;
}

.member-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start;
}

.member-image img {
    width: 100%;
    border-radius: 8px;
}

/* Contact Section */
.contact-section {
    background-color: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-item {
    margin-bottom: 20px;
}

.contact-item h4 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-item p {
    margin-left: 30px;
}

.contact-form-section h3 {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--royal-gold);
}

.required-note {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.map-section {
    background-color: #f9f9f9;
}

.map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Footer / Contact */
.main-footer {
    background-color: var(--royal-charcoal);
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.copyright {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.8;
}

.contact-info h3 {
    color: var(--royal-gold);
    margin-bottom: 15px;
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.contact-info i {
    margin-right: 10px;
    color: var(--royal-gold);
}

.footer-logo {
    text-align: center;
    margin-top: 20px;
}

.footer-logo img {
    height: 40px;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.language-switcher a {
    color: var(--royal-purple);
    text-decoration: none;
    padding: 2px 5px;
    transition: color 0.3s;
}

.language-switcher a.active {
    color: var(--royal-gold);
    font-weight: bold;
}

.language-switcher span {
    color: #999;
    margin: 0 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav ul {
        margin-top: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav li {
        margin: 5px 10px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .arabic-text {
        font-size: 1.2rem;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .membership-content {
        grid-template-columns: 1fr;
    }
    
    .top-strip p {
        font-size: 0.8rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .member-content {
        grid-template-columns: 1fr;
    }
    
    .news-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Timeline responsive */
    .timeline::before {
        left: 31px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        text-align: left;
        float: none;
    }
    
    .timeline-item:nth-child(odd) .timeline-content::after,
    .timeline-item:nth-child(even) .timeline-content::after {
        left: 51px;
        top: 30px;
    }
    
    .timeline-year {
        left: 15px;
        transform: translateX(0);
    }
    
    .timeline-item:nth-child(odd) .timeline-year,
    .timeline-item:nth-child(even) .timeline-year {
        top: 25px;
    }
    
    .timeline-image img {
        height: 120px;
    }
    
    .news-image img {
        height: 150px;
    }
}

/* Awards Section */
.awards-section {
    background-color: white;
    padding: 60px 0;
}

.filter-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.filter-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--royal-purple);
}

.filter-form .form-group input,
.filter-form .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
}

.filter-form .form-group input:focus,
.filter-form .form-group select:focus {
    outline: none;
    border-color: var(--royal-gold);
}

.filter-form .btn {
    display: inline-block;
    background-color: var(--royal-gold);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    height: fit-content;
}

.filter-form .btn:hover {
    background-color: var(--royal-gold-dark);
    transform: translateY(-2px);
}

.filter-form .btn-secondary {
    background-color: #6c757d;
}

.filter-form .btn-secondary:hover {
    background-color: #5a6268;
}

.awardees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.awardee-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    transition: var(--transition);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.awardee-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.awardee-name {
    color: var(--royal-purple);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.award-name {
    color: var(--royal-gold);
    font-weight: 500;
    margin-bottom: 5px;
}

.award-year {
    color: #666;
    font-size: 0.9rem;
}

/* Awardees Table */
.awardees-table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.awardees-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.awardees-table th,
.awardees-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.awardees-table th {
    background-color: var(--royal-gold-light);
    font-weight: 500;
    color: var(--royal-purple);
}

.awardees-table tr:hover {
    background-color: #f9f9f9;
}

@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form .form-group {
        min-width: auto;
    }
    
    .filter-form .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .awardees-table {
        font-size: 0.9rem;
    }
    
    .awardees-table th,
    .awardees-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    section {
        padding: 40px 0;
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .timeline-image img {
        height: 100px;
    }
    
    .news-image img {
        height: 120px;
    }
}