body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 800px;
    background: #fff;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #1c1e21;
}

/* --- Auth Styles --- */
#auth-container {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    text-align: center;
}

#login-form h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #333;
}

#login-form input {
    display: block;
    width: calc(80% - 22px);
    max-width: 300px;
    padding: 12px;
    margin: 10px auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}

#auth-container button {
    padding: 10px 20px;
    margin: 8px 4px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s;
}

#auth-container button:hover {
    background-color: #0056b3;
}

#logout-btn {
    background-color: #dc3545;
}

#logout-btn:hover {
    background-color: #c82333;
}

#user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#user-info p {
    font-size: 1.1em;
    margin: 0;
}

.hidden {
    display: none;
}

/* --- Service List & Dashboard Styles --- */
#dashboard {
    margin-top: 40px;
    border: 2px solid #007bff;
    padding: 20px;
    border-radius: 8px;
}

#service-list {
    margin-top: 40px;
    /* Flexbox layout for grid */
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Space between items */
}

#dashboard h2, #service-list h2 {
    text-align: center;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 10px;
    margin-bottom: 20px;
    width: 100%; /* Make header take full width */
}

/* Dashboard Item Styles */
#dashboard .service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
}

#dashboard .service-item .name {
    flex: 1;
    text-align: left;
    font-weight: bold;
    font-size: 1.1em;
}

#dashboard .service-item .status {
    flex: 1;
    text-align: center;
    font-weight: bold;
}

#dashboard .service-item .service-actions {
    flex: 1;
    text-align: right;
}

.policy-link-btn {
    display: inline-block;
    padding: 6px 12px;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.2s;
}

.policy-link-btn.policy-btn-ok {
    background-color: #28a745; /* Green */
}

.policy-link-btn.policy-btn-warning {
    background-color: #ffc107; /* Orange */
}

.policy-link-btn.policy-btn-error {
    background-color: #dc3545; /* Red */
}

.policy-link-btn:hover {
    opacity: 0.9;
}

/* Service List Item Styles */
#service-list .service-item {
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s ease-in-out, box-shadow 0.2s;
    text-align: center;
    color: white;
    /* Flex item properties */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    flex-basis: 200px; /* Adjust for number of columns */
}

#service-list .service-item .name {
    font-weight: bold;
    font-size: 1.2em;
}

#service-list .service-item .follower-count {
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0.9;
}

#service-list .service-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

#service-list .not-followed {
    background-color: #28a745; /* Green */
}

#service-list .is-followed {
    background-color: #6c757d; /* Gray */
}

.status.ok {
    color: #28a745; /* Green */
}

.status.warning {
    color: #ffc107; /* Orange */
}

.status.error {
    color: #dc3545; /* Red */
}

/* --- Feedback Styles --- */
#feedback-container {
    text-align: center;
    margin-top: 40px;
}

#open-feedback-btn {
    background-color: #6c757d;
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    border: none;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

#open-feedback-btn:hover {
    background-color: #5a6268;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#feedback-form textarea {
    width: calc(100% - 20px);
    height: 120px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1em;
    resize: vertical;
}

#feedback-form button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
}

#feedback-form button:hover {
    background-color: #0056b3;
}

/* --- Bug Fix: Ensure modal is hidden by default --- */
.modal.hidden {
    display: none;
}