/* Custom font definitions */
@font-face {
    font-family: 'Montserrat';
    src: url('/zstyles/Montserrat/static/Montserrat-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'PlayfairDisplay';
    src: url('/zstyles/Playfair_Display/static/PlayfairDisplay-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

/* Body: Full-screen gradient with centered content */
body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #6B2D5C, #3E1B3A);
    color: #F9F1E9;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Hero Section: Pulsing intro for home page */
.hero {
    text-align: center;
    padding: 20px;
    animation: pulse 3s infinite ease-in-out;
}

.hero img.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #D4A017;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.hero img:hover {
    transform: scale(1.1);
}

.hero h1 {
    font-family: 'PlayfairDisplay', serif;
    font-size: 2.5rem;
    color: #D4A017;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Container: Limits width for readability */
.container {
    max-width: 1200px;
    width: 100%;
}

/* Link Grid: Responsive layout for application cards */
.link-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding: 10px 0;
}

/* Cards: Modern, interactive design for application modules */
.card {
    background: rgba(107, 45, 92, 0.9);
    color: #F9F1E9;
    padding: 25px;
    border-radius: 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    font-size: 1.1rem;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(212, 160, 23, 0.2));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover::before {
    opacity: 1;
}

.card i {
    color: #D4A017;
    font-size: 1.5rem;
    margin-right: 15px;
}

.card span {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Card image styling (moved from inline) */
.card-image {
    width: 50px;
    height: 50px;
    margin-right: 15px;
}

/* Staggered animations for cards */
.card:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.1s both; }
.card:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.2s both; }
.card:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.3s both; }
.card:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.4s both; }
.card:nth-child(5) { animation: fadeInUp 0.6s ease-out 0.5s both; }
.card:nth-child(6) { animation: fadeInUp 0.6s ease-out 0.6s both; }
.card:nth-child(7) { animation: fadeInUp 0.6s ease-out 0.7s both; }
.card:nth-child(8) { animation: fadeInUp 0.6s ease-out 0.8s both; }

/* Social Icons: Horizontal bar */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
}

.social-icons a {
    color: #D4A017;
    font-size: 1.8rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: #F9F1E9;
    transform: scale(1.2);
}

/* Footer: Minimal and elegant */
footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: rgba(249, 241, 233, 0.7);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Responsive Design */
@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .card { padding: 20px; }
    .card span { font-size: 1rem; }
    .social-icons a { font-size: 24px; }
    .table-container {
        overflow-x: auto;
    }
    table {
        width: 100%;
        min-width: 600px; /* Ensures table is wide enough to display all columns */
    }
}

/* Buttons: Consistent interactive elements */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #D4A017;
    color: #3E1B3A;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-delete:hover {
    /* Red for delete */
    color: #f44336;
    background-color: #F9F1E9;
}

.btn:hover {
    background-color: #F9F1E9;
}

/* Messages: Feedback for user actions */
.error-message {
    color: #721c24;
    background-color: #f8d7da;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.success-message {
    color: #155724;
    background-color: #d4edda;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* Forms: Styled for admin functionality */
form {
    background: rgba(107, 45, 92, 0.9);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #D4A017;
    border-radius: 4px;
    background-color: #3E1B3A;
    color: #F9F1E9;
}

form input[type="checkbox"] {
    margin-right: 5px;
}

form button {
    background-color: #D4A017;
    color: #3E1B3A;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

form button:hover {
    background-color: #F9F1E9;
}

/* Tables: For admin management */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: rgba(107, 45, 92, 0.9);
    border-radius: 15px;
    overflow: hidden;
}

th, td {
    padding: 10px;
    text-align: left;
}

th {
    background-color: #3E1B3A;
    color: #D4A017;
}

td {
    border-bottom: 1px solid #D4A017;
}

tr:hover {
    background-color: rgba(212, 160, 23, 0.1);
}

/* Table column widths for better readability */
table th:nth-child(1), table td:nth-child(1) { width: 30%; } /* Name - URL */            
table th:nth-child(2), table td:nth-child(2) { width: 30%; } /* Image Path - Icon Class */
table th:nth-child(3), table td:nth-child(3) { width: 20%; } /* Display - Active - Order */
table th:nth-child(4), table td:nth-child(4) { width: 20%; } /* Actions */

/* Prevent long URLs from breaking layout */
td {
    word-break: break-all;
}

/* Header: For admin, login, edit pages */
header {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(107, 45, 92, 0.9);
    border-radius: 15px;
}

header h1 {
    font-family: 'PlayfairDisplay', serif;
    font-size: 2rem;
    color: #D4A017;
}

nav a {
    margin-left: 10px;
}

/* Editable fields in admin table */
.editable {
    display: inline-block;
    width: 100%;
    padding: 5px;
    border: 1px solid transparent;
    transition: border-color 0.3s, background-color 0.3s;
    cursor: text;
}

.editable:hover {
    border-color: #D4A017;
}

.editable:focus {
    border-color: #D4A017;
    background-color: #3E1B3A;
    outline: none;
}

/* Inline edit elements in admin table */
.inline-edit {
    background-color: #3E1B3A;
    color: #F9F1E9;
    border: 1px solid #D4A017;
    border-radius: 4px;
    padding: 5px;
    margin-bottom: 5px;
}

.inline-edit[type="checkbox"] {
    margin-right: 5px;
}

.inline-edit[type="number"] {
    width: 60px;
}

/* Table container for responsiveness */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Styling for the create row in the admin table */
.create-row td {
    padding: 15px;
}

.create-row input[type="text"],
.create-row input[type="number"] {
    width: 100%;
    margin: 5px 0;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #D4A017;
    background-color: #3E1B3A;
    color: #F9F1E9;
}

.create-row input[type="radio"],
.create-row input[type="checkbox"] {
    margin: 0 5px 0 0;
}

.create-row label {
    display: inline-block;
    margin: 5px 10px 5px 0;
    font-size: 0.9rem;
}

.create-row button {
    width: 100%;
    padding: 8px;
}

/* Feedback div styles (moved from admin.php) */
#update-feedback {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 10px;
    border-radius: 4px;
    display: none;
    z-index: 1000; /* Ensure it appears above other elements */
}

/* Success feedback */
#update-feedback.success {
    background-color: #d4edda;
    color: #155724;
}

/* Error feedback */
#update-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Hidden class for toggling visibility */
.hidden {
    display: none;
}