/* Page Background & Typography */
body {
    background-color: #1e1e2e;
    color: #cdd6f4;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

/* Application Layout Container */
.app-container {
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    color: #89b4fa;
    margin: 0;
}

/* Form Section Styling */
.form-section, .search-section, .list-section {
    background-color: #2b2b3b;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

h2 {
    color: #b4befe;
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group input, #search-input {
    width: 100%;
    padding: 10px 14px;
    background-color: #181825;
    border: 1px solid #45475a;
    border-radius: 6px;
    color: #cdd6f4;
    font-size: 14px;
    box-sizing: border-box;
}

.input-group input:focus, #search-input:focus {
    border-color: #89b4fa;
    outline: none;
}

.form-buttons {
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#save-btn {
    background-color: #a6e3a1;
    color: #11111b;
}

#save-btn:hover {
    background-color: #94e2d5;
}

#cancel-btn {
    background-color: #f38ba8;
    color: #11111b;
}

/* Contact Cards Responsive Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

.contact-card {
    background-color: #181825;
    border: 1px solid #45475a;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contact-card h3 {
    margin: 0 0 8px 0;
    color: #89b4fa;
}

.contact-card p {
    margin: 4px 0;
    font-size: 13px;
    color: #a6adc8;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.edit-btn {
    background-color: #f9e2af;
    color: #11111b;
    font-size: 12px;
    padding: 6px 12px;
}

.delete-btn {
    background-color: #f38ba8;
    color: #11111b;
    font-size: 12px;
    padding: 6px 12px;
}

/* Utility State Rules */
.hidden {
    display: none !important;
}

.empty-msg {
    color: #a6adc8;
    font-style: italic;
}