/* Global Styles */
* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
}

/* Header */
.header {
    width: 100%;
    background-color: #2ecc71;
    color: white;
    text-align: center;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    height: 60px;
    object-fit: contain;
    margin-right: 20px;
}

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    flex-grow: 1;
}

/* Main Content */
.marketing-4p-container {
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
    margin: 2rem auto;
}

.section-card {
    background: white;
    padding: 2rem;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h2 {
    color: #2ecc71;
    border-bottom: 2px solid #2ecc71;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: center;
}

/* P Intro */
.p-intro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.p-item {
    padding: 15px;
    border-radius: 8px;
    color: white;
}

.p-item.product { background-color: #2ecc71; }
.p-item.price { background-color: #f39c12; }
.p-item.place { background-color: #3498db; }
.p-item.promotion { background-color: #9b59b6; }

.p-item h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

.p-item p {
    font-size: 0.9rem;
    margin: 5px 0 0;
}

/* 4P Matrix */
.marketing-4p-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.p-quadrant {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.p-quadrant.product { border-left: 5px solid #2ecc71; }
.p-quadrant.price { border-left: 5px solid #f39c12; }
.p-quadrant.place { border-left: 5px solid #3498db; }
.p-quadrant.promotion { border-left: 5px solid #9b59b6; }

.p-quadrant h3 {
    margin-top: 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
}

.p-quadrant h3 .add-item-btn {
    cursor: pointer;
    color: #2ecc71;
    font-size: 1rem;
    transition: transform 0.2s;
}
.p-quadrant h3 .add-item-btn:hover {
    transform: scale(1.2);
}

.p-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    flex-grow: 1;
}

.p-item-card {
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: grab;
    transition: box-shadow 0.2s;
}
.p-item-card:hover {
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}
.p-item-card.dragging {
    opacity: 0.5;
}

.p-item-card textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 1rem;
    min-height: 40px;
    background: transparent;
}
.p-item-card textarea:focus {
    outline: 1px solid #ccc;
    background: #f0f0f0;
}

.item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 5px;
}
.item-actions .action-btn {
    color: #777;
    cursor: pointer;
    transition: color 0.2s;
}
.item-actions .action-btn:hover {
    color: #000;
}
.item-actions .fa-trash-alt:hover { color: #e74c3c; }

.rating-container {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    margin-top: 5px;
}
.rating-container .stars {
    display: flex;
}
.rating-container .fa-star {
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s;
}
.rating-container .fa-star.active {
    color: #ffc107;
}

/* Buttons and Form */
.button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
}
.form-label {
    font-weight: bold;
}
.form-control {
    width: 250px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-primary, .btn-success {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-primary { background-color: #007bff; color: white; }
.btn-success { background-color: #2ecc71; color: white; }
.btn-primary:hover, .btn-success:hover { filter: brightness(1.1); }

/* Analysis Results */
.analysis-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}
.chart-container {
    height: 400px;
    width: 100%;
}
.analysis-feedback {
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
}
.analysis-feedback h3 {
    text-align: center;
    color: #007bff;
}

/* Footer */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px;
    width: 100%;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .marketing-4p-container {
        padding: 1rem;
    }
    .header-title {
        font-size: 1rem;
    }
    .p-intro, .marketing-4p-matrix, .analysis-results {
        grid-template-columns: 1fr;
    }
}