@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap');

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    background-color: #f5f5f7; /* Apple light gray background */
    color: #1d1d1f; /* Apple near black text */
    padding: 20px;
}

/* Header */
header {
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #d2d2d7; /* Apple light gray border */
}

.header-top {
    display: flex; 
    align-items: center; 
    margin-bottom: 15px;
    max-width: 1200px; /* Align with main content */
    margin-left: auto;  /* Center it */
    margin-right: auto; /* Center it */
    padding-left: 20px; /* Match body padding for alignment */
    padding-right: 20px;/* Match body padding for alignment */
}

.logo-container h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.0em;
    font-weight: 700;
    margin: 0;
    /* padding-left: 15px; Removed for alignment with main content */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    background-image: linear-gradient(to right, violet, indigo, blue, green, yellow, orange, red, violet);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow-text-animation 10s ease-in-out infinite alternate;
    background-size: 200% 200%;
}

.search-container {
    display: flex;
    align-items: center;
    margin-left: auto; /* Pushes search to the right */
    /* margin-right: 15px; Removed, alignment handled by parent padding */
}

#search-bar {
    padding: 10px 15px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 0.95em;
    width: 280px; /* Fixed width, can be adjusted */ 
    /* min-width removed to allow it to be less wide if needed */
}

#search-bar:focus {
    outline: none;
    border-color: #007aff; /* Apple blue focus */
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.slogan-container {
    text-align: center;
    margin-bottom: 20px;
}

.slogan-container p {
    font-size: 1.2em;
    color: #333333; /* Slightly darker for emphasis */
    font-weight: 400;
}

/* Main Content Area */
main {
    max-width: 1200px;
    margin: 0 auto;
}

/* Category Section */
.category-section {
    margin-bottom: 40px;
}

.category-section h2 {
    font-size: 1.8em;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5; /* Lighter border for category titles */
}

/* Tool Grid/List */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Tool Card */
.tool-card {
    background-color: #ffffff; /* White card background */
    border-radius: 12px; /* Apple-like rounded corners */
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Subtle shadow */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes description down if card heights vary */
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.tool-card h3 {
    font-size: 1.2em;
    font-weight: 500;
    margin-bottom: 8px;
}

.tool-card h3 a {
    text-decoration: none;
    /* Default link color will be overridden by category-specific styles */
}

.tool-card h3 a:hover {
    text-decoration: underline;
}

/* Category Specific Link and Title Colors */
.category-website-essentials h2 {
    color: #007aff; /* Apple Blue */
}
.category-domain-hosting h2 {
    color: #34c759; /* Apple Green */
}
.category-inspiration h2 {
    color: #ff9500; /* Apple Orange */
}
.category-marketing h2 {
    color: #ff2d55; /* Apple Pink */
}
.category-keyword-search h2 {
    color: #5ac8fa; /* Apple Teal */
}
.category-monetization h2 {
    color: #af52de; /* Apple Purple */
}

/* Category Specific Link Colors */
.category-website-essentials .tool-card h3 a {
    color: #007aff; /* Apple Blue */
}

.category-domain-hosting .tool-card h3 a {
    color: #34c759; /* Apple Green */
}

.category-inspiration .tool-card h3 a {
    color: #ff9500; /* Apple Orange */
}

.category-marketing .tool-card h3 a {
    color: #ff2d55; /* Apple Pink */
}

.category-keyword-search .tool-card h3 a {
    color: #5ac8fa; /* Apple Teal */
}

.category-monetization .tool-card h3 a {
    color: #af52de; /* Apple Purple */
}

.tool-card p {
    font-size: 0.95em;
    color: #555555; /* Dark gray for description */
    flex-grow: 1; /* Allows description to take available space */
}

/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding: 20px 0;
    border-top: 1px solid #d2d2d7;
    font-size: 0.9em;
    color: #555555;
}

@keyframes rainbow-text-animation {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    .header-top {
        padding-left: 15px; /* Match new body padding */
        padding-right: 15px;/* Match new body padding */
    }

    .logo-container h1 {
        font-size: 2.2em; /* Adjusted for mobile */
        padding-left: 0; /* Align with edge on mobile */
    }

    .slogan-container p {
        font-size: 1.1em;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-container {
        width: 100%;
        margin-top: 10px;
    }

    #search-bar {
        width: 100%;
    }

    header p {
        font-size: 1em;
    }

    .category-section h2 {
        font-size: 1.5em;
    }

    .tool-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
    }

    .tool-card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header-top {
        padding-left: 10px; /* Adjust for smaller screens */
        padding-right: 10px;/* Adjust for smaller screens */
    }
    .logo-container h1 {
        font-size: 2.0em; /* Adjusted for smaller mobile */
        padding-left: 0; /* Align with edge on smaller mobile */
    }
    .slogan-container p {
        font-size: 1em;
    }

    .category-section h2 {
        font-size: 1.3em;
    }

    .tool-card h3 {
        font-size: 1.1em;
    }

    .tool-card p {
        font-size: 0.9em;
    }
}
