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

/* CSS Variables for Colors */
:root {
    --primary-color: #007bff; /* Blue */
    --primary-color-darker: #0056b3;
    --secondary-color: #6c757d; /* Gray */
    --light-gray-color: #f8f9fa;
    --dark-gray-color: #343a40;
    --text-color: #212529;
    --link-color: #007bff;
    --success-color: #28a745;
    --error-color: #dc3545;
    --white-color: #ffffff;
    --border-color: #dee2e6;
}

/* Global Typography & Body */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white-color);
    font-size: 16px;
    padding-top: 60px; /* Default padding for fixed header, can be overridden */
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

/* Basic Button Styling */
.btn {
    display: inline-block;
    font-weight: 400;
    color: var(--white-color);
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.btn:hover {
    background-color: var(--primary-color-darker);
    border-color: var(--primary-color-darker);
    color: var(--white-color);
    text-decoration: none;
}
.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.btn-secondary:hover {
    background-color: #545b62; /* Darker gray */
    border-color: #545b62;
}
.btn-large {
    padding: 0.75rem 1.25rem;
    font-size: 1.15rem;
}
button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}


/* Basic Form Styling */
.form-group {
    margin-bottom: 1rem;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--white-color);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
input[readonly], input[disabled] {
    background-color: var(--light-gray-color);
    opacity: 0.7;
}
select {
    height: calc(1.5em + 1rem + 2px); /* Match input height */
}
textarea {
    resize: vertical;
}
input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Error and Success Messages (Basic) */
.errors {
    color: var(--error-color);
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 0.25rem;
}
.errors ul {
    list-style-position: inside;
    padding-left: 0;
}
.success-message {
    color: var(--success-color);
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 0.25rem;
}

/* Header Styling (General - can be overridden by specific headers) */
/* This is a placeholder for where more specific header styles would go if not in individual files */
/* For example, the landing page header and dashboard header will have their own rules */
/* .site-header { ... } */

/* Footer Styling (General) */
/* .site-footer { ... } */

/* Utility Classes */
.text-center {
    text-align: center;
}
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }

/* --- Landing Page Styles (`index.php`) --- */

/* Override body padding for landing page if header is not fixed or different */
body.landing-page {
    padding-top: 0; /* Remove default padding if landing header is part of flow */
}

.landing-header {
    background-color: var(--white-color);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: fixed; /* Make header fixed */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Ensure it's above other content */
}

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

.landing-header .logo {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-color);
}

.landing-header nav a {
    margin-left: 15px;
    font-weight: 500;
}

.landing-header nav a.btn-primary {
    color: var(--white-color); /* Ensure text color is white for button */
}
.landing-header nav a.btn-primary:hover {
    color: var(--white-color);
}


/* Hero Section */
#hero {
    background-color: var(--primary-color); /* Primary color background */
    color: var(--white-color);
    padding: 120px 0 80px 0; /* Increased padding, accounts for fixed header */
    text-align: center;
    margin-top: 70px; /* Adjust if landing-header height changes */
}

#hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

#hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

#hero .btn-cta {
    background-color: var(--white-color);
    color: var(--primary-color);
    font-weight: bold;
    padding: 1rem 2rem;
    font-size: 1.2rem;
}
#hero .btn-cta:hover {
    background-color: #f0f0f0; /* Slightly off-white */
    color: var(--primary-color-darker);
}


/* How It Works Section */
#how-it-works {
    padding: 60px 0;
    text-align: center;
}
#how-it-works h2 {
    margin-bottom: 40px;
    font-size: 2rem;
}
#how-it-works .steps {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}
#how-it-works .step {
    flex-basis: 30%; /* Adjust as needed */
    min-width: 280px; /* Ensure steps don't get too narrow */
    padding: 20px;
    margin-bottom: 20px;
}
#how-it-works .step-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    /* In a real scenario, replace [ICON: ...] with actual <img> or <svg> or font icon */
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    background-color: var(--light-gray-color);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
}
#how-it-works .step h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark-gray-color);
}


/* Features Section */
#features {
    background-color: var(--light-gray-color);
    padding: 60px 0;
    text-align: center;
}
#features h2 {
    margin-bottom: 40px;
    font-size: 2rem;
}
#features .feature-list {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}
#features .feature-item {
    flex-basis: 22%; /* For 4 items, adjust for 3 or other counts */
    min-width: 250px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
#features .feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    /* Placeholder styling for icon */
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    background-color: #e9ecef; /* Light background for icon */
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
#features .feature-item h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-gray-color);
}

/* Stats/Testimonials Section */
#stats-testimonials {
    padding: 60px 0;
    text-align: center;
}
#stats-testimonials h2 {
    margin-bottom: 40px;
    font-size: 2rem;
}
#stats-testimonials .stats-placeholder p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}
#stats-testimonials .stats-placeholder strong {
    color: var(--primary-color);
    font-size: 1.5rem;
}
#stats-testimonials .stats-placeholder em {
    display: block;
    margin-top: 1rem;
    color: #555;
    font-style: italic;
}

/* Landing Page Footer */
.landing-footer {
    background-color: var(--dark-gray-color);
    color: var(--light-gray-color);
    padding: 30px 0;
    text-align: center;
}
.landing-footer nav a {
    color: var(--white-color);
    margin: 0 10px;
    font-size: 0.9rem;
}
.landing-footer nav a:hover {
    color: var(--primary-color);
}
.landing-footer p {
    margin-top: 15px;
    font-size: 0.9rem;
}

/* --- Login/Register Page Specific Styles --- */
.auth-container {
    max-width: 450px;
    margin: 60px auto; /* Adjust margin-top if body padding-top is different */
    padding: 30px;
    background-color: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.auth-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--dark-gray-color);
}
.auth-container .form-group label {
    font-weight: normal; /* Lighter labels for auth forms */
}
.auth-container .form-group input[type="checkbox"] + label {
    font-weight: normal;
    display: inline; /* For TOS checkbox */
}
.auth-container button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
    margin-top: 10px;
}
.auth-container p {
    text-align: center;
    margin-top: 20px;
    font-size: 0.95rem;
}

/* Add a class to body of login/register pages if needed to adjust padding-top */
body.auth-page {
    padding-top: 0; /* If no fixed header on these pages */
    background-color: var(--light-gray-color); /* Light gray background for auth pages */
}

/* --- Authenticated User Area Common Styles --- */

/* General Body style for dashboard pages - ensure padding-top for fixed header */
/* The global body style already has padding-top: 60px; which should work if dashboard-header is fixed. */
/* If dashboard-header height changes, this might need adjustment or a specific class for auth area body */

.dashboard-header {
    background-color: var(--dark-gray-color); /* Dark background for dashboard header */
    color: var(--white-color);
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Ensure it's above other content */
    border-bottom: 2px solid var(--primary-color);
}

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

.dashboard-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white-color); /* Ensure logo is white */
}

.dashboard-header nav a {
    color: #e0e0e0; /* Lighter text color for nav links */
    margin-left: 15px;
    padding: 0.5rem 0.25rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.dashboard-header nav a:hover,
.dashboard-header nav a.active { /* Add .active class with JS for current page */
    color: var(--white-color);
    text-decoration: none;
    border-bottom-color: var(--primary-color);
}

/* Main content area for dashboard pages */
.main-container.container {
    /* This class is opened in includes/header.php and closed in includes/footer.php */
    /* It already has global container styles. We add top margin to account for fixed header */
    margin-top: 80px; /* Adjust based on actual .dashboard-header height + a little space */
    margin-bottom: 40px; /* Space before footer */
    padding-top: 20px; /* Inner padding for the content block */
    padding-bottom: 20px;
    background-color: var(--white-color); /* Ensure content area background */
   /* box-shadow: 0 0 15px rgba(0,0,0,0.05); /* Optional subtle shadow */
   /* border-radius: 4px; /* Optional rounded corners for content block */
}

.content-area { /* Used in profile.php, my_websites.php, surf.php's main content block */
    padding: 20px;
    background-color: var(--white-color); /* Default for content sections */
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px; /* Space between content blocks if multiple on a page */
}
.content-area h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
}


/* Table Styling */
.websites-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.websites-table th,
.websites-table td {
    border: 1px solid var(--border-color);
    padding: 10px 12px; /* Increased padding */
    text-align: left;
    vertical-align: middle;
}
.websites-table th {
    background-color: var(--light-gray-color);
    font-weight: 600; /* Slightly bolder */
    color: var(--dark-gray-color);
}
.websites-table tbody tr:nth-child(even) {
    background-color: #fdfdfd; /* Very light striping for even rows */
}
.websites-table tbody tr:hover {
    background-color: #f1f1f1; /* Hover effect */
}
.websites-table td a {
    font-weight: 500;
}
.websites-table button {
    padding: 0.25rem 0.5rem; /* Smaller buttons for table actions */
    font-size: 0.85rem;
    margin-right: 5px;
}


/* Form styling within dashboard - mostly covered by global, but specific adjustments if needed */
.form-add-website,
.profile-update-form { /* Assuming profile form gets a class if needed */
    /* background-color: #fdfdfd; */
    /* padding: 20px; */
    /* border-radius: 5px; */
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.05); */
}
.form-add-website .form-group,
.profile-update-form .form-group {
    /* Specific spacing or layout for forms in content areas */
}
.form-add-website small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85em;
    color: var(--secondary-color);
}


/* Dashboard Footer (if different from landing) */
.dashboard-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--secondary-color);
    background-color: var(--light-gray-color); /* Light background for separation */
}
/* Ensure dashboard footer is visible, overriding surf page style if necessary */
body:not(.surf-page-body) .dashboard-footer { /* Example: add class to surf page body */
    display: block !important;
}
/* Or, if surf.php styles are self-contained, this might not be needed */
/* The current surf.php hides .dashboard-footer directly with inline style, which is more specific */

/* --- Dashboard Page (`dashboard.php`) Specific Styles --- */

.dashboard-content h2 { /* The main "Welcome, Username!" h2 */
    /* color: var(--dark-gray-color); */ /* Already has general .content-area h2 styling */
    /* font-size: 1.8rem; */
    margin-bottom: 25px;
}

.dashboard-summary {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: space-between; /* Distribute space between cards */
    gap: 20px; /* Space between cards */
    margin-bottom: 30px;
}

.summary-card {
    background-color: var(--white-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    text-align: center;
    flex-grow: 1; /* Allow cards to grow */
    flex-basis: 200px; /* Minimum width before wrapping */
    /* border-left: 4px solid var(--primary-color); /* Accent border */
}

.summary-card h4 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .figure {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0;
}

.dashboard-quick-actions {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--light-gray-color);
    border-radius: 8px;
}

.dashboard-quick-actions h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--dark-gray-color);
}

.dashboard-quick-actions .btn {
    margin-right: 10px;
    margin-bottom: 10px; /* For wrapping */
}

.recent-activity {
    padding: 20px;
    background-color: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.recent-activity h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--dark-gray-color);
}
.recent-activity p {
    color: var(--secondary-color);
}

/* --- Surf Page (`surf.php`) Specific Styles --- */

/* Body class to override general padding for fixed header, if needed */
body.surf-page-body {
    padding-top: 0; /* Surf page manages its own header (the surf-bar) */
    overflow-y: hidden; /* Prevent body scrollbars when iframe is focus */
}

/* Remove top margin from main-container if dashboard-header is not shown/relevant */
body.surf-page-body .main-container.container {
    margin-top: 0;
    padding-top: 0;
    max-width: 100%; /* Allow surf container to be full width */
    height: 100vh; /* Full viewport height */
    padding: 0; /* No padding for the main container on surf page */
}

.surf-page-content { /* The <main> element on surf.php */
    height: 100%;
}

#surf-container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Fill the .surf-page-content */
    background-color: #e8e8e8; /* Background for the surf area */
}

.surf-bar {
    background-color: #333; /* Darker surf bar */
    color: var(--white-color);
    padding: 10px 15px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 50px; /* Ensure it has some height */
}

.surf-bar .timer,
.surf-bar .site-info,
.surf-bar .actions {
    margin: 0 10px;
    display: flex;
    align-items: center;
}

.surf-bar .timer {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color); /* Make timer stand out */
}
.surf-bar .timer span { min-width: 25px; display: inline-block; text-align: right;}


.surf-bar .site-info {
    flex-grow: 1;
    text-align: center;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.surf-bar .site-info #current-site-url {
    font-weight: 500;
    margin-left: 5px;
}
.surf-bar .site-info #site-credits-value {
    font-weight: bold;
}

.surf-bar .actions button {
    background-color: var(--secondary-color);
    color: var(--white-color);
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-left: 10px;
    border-radius: 3px;
}
.surf-bar .actions button:hover {
    background-color: #5a6268;
}
.surf-bar .actions button:disabled {
    background-color: #555;
    opacity: 0.7;
}
.surf-bar .actions button#next-site-btn { /* If styled differently */
    background-color: var(--success-color);
}
 .surf-bar .actions button#next-site-btn:hover {
    background-color: #1e7e34;
 }


.surf-iframe-wrapper {
    flex-grow: 1;
    overflow: hidden;
    border: 5px solid #333; /* Border matches surf-bar */
    border-top: none; /* No top border as it connects to surf-bar */
    background-color: var(--white-color); /* Shows if iframe is slow to load */
}

#surf-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#surf-controls { /* Start/Pause buttons area */
    background-color: #f0f0f0;
    padding: 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent shrinking */
}
#surf-status-message {
    text-align: center;
    padding: 5px;
    font-size: 0.9rem;
    min-height: 20px; /* Prevent layout jump */
}

/* Hide standard header and footer on surf page */
body.surf-page-body .dashboard-header,
body.surf-page-body .dashboard-footer {
    display: none !important;
}

/* --- Refinements --- */

/* Add a subtle hover effect to summary cards on the dashboard */
.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Add a subtle hover effect to feature items on the landing page */
#features .feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Ensure consistency for form buttons within content areas */
.content-area form button[type="submit"] {
    /* padding: 0.6rem 1.2rem; */ /* Using global .btn style */
    /* font-size: 1rem; */
    /* margin-top: 10px; */ /* Add if not already spaced by form-group */
}

/* Adjusting auth-container margin if landing-header is fixed and body padding is not 0 */
/* This is a check. Current setup: auth-page has body padding-top:0, so not an issue. */
/* If auth-page body had padding-top, this would be needed: */
/*
body.auth-page .auth-container {
    margin-top: calc(60px + 30px); /* header_height + desired_space */
}
*/

/* Minor adjustment to ensure logout link in dashboard header looks like other links */
.dashboard-header nav a[href="logout.php"] {
    /* Usually fine, but if it needs to be more button-like: */
    /* background-color: var(--secondary-color); */
    /* padding: 0.4rem 0.8rem; */
    /* border-radius: 3px; */
    /* border-bottom-color: transparent !important; */ /* Override underline effect if button-like */
}
/* .dashboard-header nav a[href="logout.php"]:hover {
    background-color: #5a6268;
    color: var(--white-color);
} */
