/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&family=Kalam:wght@300;400;700&display=swap');

body {
    font-family: 'Kalam', cursive;
    background-color: #f5f1e6;
    background-image: 
        radial-gradient(#d4c8a9 2px, transparent 2px),
        radial-gradient(#d4c8a9 2px, transparent 2px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    color: #4a3c1c;
    line-height: 1.7;
    min-height: 100vh;
    padding: 10px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0,0 Q50,20 100,0 L100,100 Q50,80 0,100 Z" fill="rgba(194,178,128,0.05)"/></svg>'),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><circle cx="50" cy="50" r="15" fill="rgba(194,178,128,0.03)"/><circle cx="150" cy="150" r="20" fill="rgba(194,178,128,0.03)"/></svg>');
    background-size: 100px 100px, 200px 200px;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 25px;
    position: relative;
}

/* Hand-drawn border effect */
.container::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 3px solid #8b7355;
    border-radius: 15px;
    pointer-events: none;
    box-shadow: 
        inset 4px 4px 0 rgba(139, 115, 85, 0.1),
        inset -4px -4px 0 rgba(139, 115, 85, 0.1);
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 45px;
    padding: 25px 0;
    position: relative;
}

.header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 4px;
    background: 
        repeating-linear-gradient(
            to right,
            #8b7355,
            #8b7355 10px,
            transparent 10px,
            transparent 20px
        );
}

.logo {
    font-family: 'Patrick Hand', cursive;
    font-size: 3.5rem;
    font-weight: 400;
    color: #5d4a2e;
    letter-spacing: 2px;
    text-shadow: 3px 3px 0 #d4c8a9, 6px 6px 0 rgba(139, 115, 85, 0.2);
    position: relative;
    display: inline-block;
    padding: 10px 30px;
    background: 
        linear-gradient(135deg, #f8f4e3 0%, #e8e2cc 100%);
    border-radius: 12px;
    transform: rotate(-2deg);
    box-shadow: 
        0 0 0 4px #d4c8a9,
        8px 8px 0 rgba(139, 115, 85, 0.3);
}

.logo::before {
    content: "✍";
    position: absolute;
    top: -20px;
    left: -15px;
    font-size: 1.8rem;
    transform: rotate(-20deg);
}

.logo span {
    color: #8b7355;
}

/* Search Section */
.search-section {
    max-width: 800px;
    margin: 0 auto 40px;
}

.search-container {
    display: flex;
    gap: 15px;
}
.search-container form {
    width: 100%;
    display: flex;
    gap: 10px;
}
#search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #8b7355;
    border-radius: 12px;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
    background-color: #f8f4e3;
    font-family: 'Kalam', cursive;
    box-shadow: inset 3px 3px 0 rgba(139, 115, 85, 0.1);
}

#search-input:focus {
    border-color: #5d4a2e;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.3);
}

.search-btn {
    padding: 12px 8px;
    background: #8b7355;
    color: #f8f4e3;
    border: 2px solid #5d4a2e;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Kalam', cursive;
    box-shadow: 3px 3px 0 rgba(93, 74, 46, 0.3);
}

.search-btn:hover {
    background: #5d4a2e;
    color: #f8f4e3;
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 rgba(93, 74, 46, 0.3);
}

/* Bookmarks Section */
.bookmarks-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #5d4a2e;
    text-align: center;
    font-family: 'Patrick Hand', cursive;
    text-shadow: 2px 2px 0 #d4c8a9;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 20px;
    background: #f8f4e3;
    border-radius: 8px;
    border: 2px dashed #8b7355;
}

.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.bookmark-category {
    background: #f8f4e3;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 
        5px 5px 0 rgba(139, 115, 85, 0.3),
        inset 2px 2px 0 rgba(212, 200, 169, 0.5);
    transition: all 0.3s ease;
    border: 2px solid #d4c8a9;
    position: relative;
    transform: rotate(1deg);
}

.bookmark-category:nth-child(2n) {
    transform: rotate(-1deg);
}

.bookmark-category:nth-child(3n) {
    transform: rotate(2deg);
}

.bookmark-category:hover {
    transform: translateY(-8px) rotate(0deg);
    box-shadow: 
        8px 8px 0 rgba(139, 115, 85, 0.5),
        inset 2px 2px 0 rgba(212, 200, 169, 0.5);
}

.bookmark-category h3 {
    font-size: 1.4rem;
    margin-bottom: 18px;
    color: #5d4a2e;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Patrick Hand', cursive;
    text-shadow: 1px 1px 0 #d4c8a9;
    padding-bottom: 8px;
    border-bottom: 2px dotted #d4c8a9;
}

.bookmark-category h3 i {
    font-size: 1.5rem;
    color: #8b7355;
}

.bookmark-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.bookmark-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    text-decoration: none;
    color: #4a3c1c;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #e8e2cc;
    border: 1px solid #d4c8a9;
    box-shadow: 2px 2px 0 rgba(139, 115, 85, 0.2);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.bookmark-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(139, 115, 85, 0.1) 3px,
        rgba(139, 115, 85, 0.1) 6px
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bookmark-link:hover {
    background: #d4c8a9;
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 rgba(139, 115, 85, 0.2);
}

.bookmark-link:hover::before {
    opacity: 1;
}

.bookmark-link i {
    font-size: 1.4rem;
    width: 28px;
    text-align: center;
    color: #8b7355;
}

.bookmark-link span {
    font-size: 1.1rem;
    font-weight: 500;
}

/* News Section */
.news-section {
    margin-bottom: 40px;
}

.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.news-item {
    background: #f8f4e3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        6px 6px 0 rgba(139, 115, 85, 0.4),
        inset 2px 2px 0 rgba(212, 200, 169, 0.5);
    transition: all 0.3s ease;
    border: 2px solid #d4c8a9;
    position: relative;
    transform: rotate(-1deg);
}

.news-item:nth-child(2n) {
    transform: rotate(1deg);
}

.news-item:nth-child(3n) {
    transform: rotate(-2deg);
}

.news-item:hover {
    transform: translateY(-10px) rotate(0deg);
    box-shadow: 
        10px 10px 0 rgba(139, 115, 85, 0.6),
        inset 2px 2px 0 rgba(212, 200, 169, 0.5);
}

.news-image {
    min-height: 160px;
    background-color: #e8e2cc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.news-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(139, 115, 85, 0.1) 10px,
            rgba(139, 115, 85, 0.1) 20px
        );
}

.news-image i {
    font-size: 3rem;
    color: #d4c8a9;
}

.news-content {
    padding: 20px;
}

.news-source {
    font-size: 0.9rem;
    color: #8b7355;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Patrick Hand', cursive;
}

.news-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #5d4a2e;
    line-height: 1.4;
}

.news-time {
    font-size: 0.85rem;
    color: #8b7355;
    font-style: italic;
}

/* Legal Navigation */
.legal-nav-bottom {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 40px;
    padding: 25px 0;
    position: relative;
}

.legal-nav-bottom::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: 
        repeating-linear-gradient(
            to right,
            #8b7355,
            #8b7355 15px,
            transparent 15px,
            transparent 30px
        );
}

.legal-link-bottom {
    text-decoration: none;
    color: #5d4a2e;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f8f4e3;
    border: 2px solid #d4c8a9;
    box-shadow: 3px 3px 0 rgba(139, 115, 85, 0.3);
    font-weight: 500;
    font-family: 'Kalam', cursive;
    position: relative;
    overflow: hidden;
}

.legal-link-bottom::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(139, 115, 85, 0.2),
        transparent
    );
    transition: 0.5s;
}

.legal-link-bottom:hover {
    background: #e8e2cc;
    color: #8b7355;
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 rgba(139, 115, 85, 0.3);
}

.legal-link-bottom:hover::before {
    left: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .logo {
        font-size: 2.8rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .bookmarks-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .legal-nav-bottom {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}