/* styles.css */
:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --accent-color: #ea4335;
    --light-color: #f8f9fa;
    --dark-color: #202124;
    --gray-color: #5f6368;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: var(--dark-color);
    line-height: 1.6;
    padding: 1rem;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

h2 {
    color: var(--primary-color);
    margin: 1.5rem 0;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    font-weight: 500;
    gap: 0.5rem;
}

.add-btn:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    color: white;
}

/* Table Styles */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Minimum width before responsive kicks in */
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: #f5f8ff;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions a {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.actions a:first-child {
    background-color: #e8f0fe;
    color: var(--primary-color);
}

.actions a:first-child:hover {
    background-color: #d2e3fc;
}

.actions a:last-child {
    background-color: #fce8e6;
    color: var(--accent-color);
}

.actions a:last-child:hover {
    background-color: #f9c9c4;
}

/* Responsive Table */
@media (max-width: 768px) {
    /* Switch table to card layout on small screens */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        margin-bottom: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 0.5rem;
    }
    
    td {
        /* Behave like rows */
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 40%;
    }
    
    td:before {
        /* Now like a table header */
        position: absolute;
        top: 50%;
        left: 1rem;
        transform: translateY(-50%);
        width: 35%;
        padding-right: 1rem;
        white-space: nowrap;
        font-weight: 600;
        color: var(--gray-color);
    }
    
    /* Label the data */
    td:nth-of-type(1):before { content: "Package"; }
    td:nth-of-type(2):before { content: "Title"; }
    td:nth-of-type(3):before { content: "Description"; }
    td:nth-of-type(4):before { content: "Actions"; }
    
    .actions {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.5rem;
    }
    
    td {
        padding-left: 35%;
    }
    
    td:before {
        width: 30%;
        font-size: 0.85rem;
    }
    
    .actions {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .actions a {
        width: 100%;
        text-align: center;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-wrapper {
    animation: fadeIn 0.4s ease-out;
}

/* Status indicators */
.status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status.active {
    background-color: var(--secondary-color);
}

.status.inactive {
    background-color: var(--accent-color);
}